shobhitsharma / embedo

Embeds third party content to DOM with perks 🧙‍♀️ (7kb gzip / standalone)
https://shobhitsharma.github.io/embedo
MIT License
348 stars 32 forks source link

feat: add support of new instagram and facebook api #26

Closed shobhitsharma closed 3 years ago

shobhitsharma commented 3 years ago

What?

Facebook Graph API introduced new oembed endpoints which includes access_token parameter, for both server and client side embeds. Developers manually have to generate those token and use in respective apps/websites based on format {app-id}|{client-token}. See docs below for more info:

🎉 To embed facebook or instagram posts, it is required to set access_token property globally or in single instance. This will automatically injected to all embed URLs called with the embedo's instance. No other breaking changes.

// facebook initialize options
new Embedo({
  facebook: {
    appId: {your-app-id},
    access_token: {your-app-id|your-client-token}
  }
});

// instagram initialize options
new Embedo({
  instagram: {
    access_token: {your-app-id|your-client-token}
  }
});

Why?

Closes #25

Screenshots

Requests 200 OK

Screenshot 2020-10-30 at 20 43 07 Screenshot 2020-10-30 at 20 43 23

Embed Test Screenshots

Screenshot 2020-10-30 at 20 42 43 Screenshot 2020-10-30 at 20 46 54 Screenshot 2020-10-30 at 20 47 07