Skip to content

Feat/instagram ingest#31

Open
rasheed1306 wants to merge 45 commits intomasterfrom
feat/instagram-ingest
Open

Feat/instagram ingest#31
rasheed1306 wants to merge 45 commits intomasterfrom
feat/instagram-ingest

Conversation

@rasheed1306
Copy link
Collaborator

This pull request introduces a Instagram OAuth integration, including both backend API routes and frontend UI components, to enable organizations to connect and disconnect their Instagram accounts. It also refactors the authentication callback flow and improves user feedback on successful connections. The most important changes are grouped below:

Instagram OAuth Integration:

  • Added new API routes for Instagram OAuth, including endpoints to generate the OAuth URL (oauth-url), handle the callback (callback), exchange tokens (exchange-token), and disconnect the account (disconnect). These endpoints handle the full OAuth flow, token management, and database updates for connected Instagram accounts. [1] [2] [3] [4]
  • Introduced a new client-side component, ConnectInstagramButton, which allows organization users to connect or disconnect their Instagram account, with proper loading states and toast notifications.
  • Updated the AuthButton component to show the Instagram connect/disconnect button for organization profiles. [1] [2]

Authentication Flow Improvements:

  • Refactored the OAuth callback logic for Supabase authentication into a new route (/auth/oauth/callback), and updated all Google and email authentication flows to use this new callback route. [1] [2] [3] [4] [5]

Frontend User Feedback:

  • Enhanced the home page to display a success message when an Instagram account is connected, using a Suspense-wrapped HomeContent component that listens for the appropriate query parameter. [1] [2]

Third-party SDK Initialization:

  • Injected the Facebook SDK into the HTML <head> using Next.js Script components to support Instagram Graph API features. [1] [2]

These changes collectively provide a robust Instagram connection experience for users, ensure secure OAuth handling, and improve feedback and reliability across the authentication flow.

create deno script to use edge functions and simplify code
fix: resolve linting error with explicit any
Add Nulls first check to add priority to new instagram accounts for cron job
This prevents wasting requests trying to catch-up with accounts which have been signed out for a long time.
Implemetation:
request latest 50 posts
Check if a posts timestamp is less than last_synced_at if is the case stops process to prevent duplication of posts
IF more than 50 new posts upon resigning it process 50 latest posts but ignores the posts before that.
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant