sugarshin / react-instagram-embed

The React component for embedding Instagram posts
https://sugarshin.github.io/react-instagram-embed/
255 stars 71 forks source link

Recent change of oembed to the graph api #348

Open SiiiTschiii opened 3 years ago

SiiiTschiii commented 3 years ago

Does this library use the new instagram_oembed endpoint via the facebook graph api [1]? Asking this because I would like to use it later on. But currently I am still struggling to do even raw requests to the endpoint for dev purpose. Reason for this see https://developers.facebook.com/community/threads/388554676046719/?post_id=388554679380052 . Many thanks for your answer and maybe somebody of you has or had the same struggle.

[1] https://developers.facebook.com/docs/instagram/oembed/ https://developers.facebook.com/docs/features-reference/oembed_read https://developers.facebook.com/docs/graph-api/reference/instagram-oembed/

olaf-otto commented 2 years ago

Yes, it is using the current graph API endpoint:

  private fetchEmbed(queryParams: string): void {
    this.request = this.createRequestPromise(`https://graph.facebook.com/v11.0/instagram_oembed/?${queryParams}`);

    if (this.props.onLoading) {
      this.props.onLoading();
    }

    this.request.promise.then(this.handleFetchSuccess).catch(this.handleFetchFailure);
  }

(https://github.com/sugarshin/react-instagram-embed/blob/master/src/index.tsx)