Skip to content

Scrappy Twitter API is a Go-backend project that is secured by the Magic SDK. This Next.js app authenticates the user and gives the access token required to make POST or DELETE requests with the Scrappy Twitter API.

Notifications You must be signed in to change notification settings

magiclabs/scrappy-twitter-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrappy Twitter API

Scrappy Twitter API is a Go-backend project that is secured by the Magic SDK for Go.

Scrappy Twitter API (CLIENT)

This Next.js app authenticates the user and generates the Decentralised ID Token (DIDT) required to make POST or DELETE requests with the Scrappy Twitter API.

Noteworthy Package Dependencies:

  • Magic SDK: Allows users to sign up or log in.
  • SWR: Lets us get user info using a hook.
  • @hapi/iron: Lets us encrypt the login cookie for more security.

Quickstart

Magic Setup

  1. Sign up for an account on Magic.
  2. Create an app.
  3. Copy your app's Test Secret Key (you'll need it soon).

Client Setup

  1. git clone https://github.com/seemcat/scrappy-twitter-api-client.git

  2. cd scrappy-twitter-api-client

  3. mv .env.local.example .env.local

  4. Populate .env.local with the correct Test keys from your Magic app:

    NEXT_PUBLIC_MAGIC_TEST_PUBLISHABLE_KEY=pk_test_XXXXX
    NEXT_PUBLIC_MAGIC_TEST_SECRET_KEY=sk_test_XXXXX
    NEXT_PUBLIC_HAPI_IRON_SECRET=this-is-a-secret-value-with-at-least-32-characters
    

    Note: The HAPI_IRON_SECRET is needed by @hapi/iron to encrypt an object. Feel free to leave the default value as is in dev.

  5. yarn

  6. yarn dev

  7. Generate your DID token and keep this open (you'll need it soon).

Test with Postman

  1. Follow the steps listed here to spin up your own local Go server and to set up the Scrappy Twitter API Postman Collection.
  2. You'll be passing the DID token you just generated as a Bearer token into the Postman Collection’s HTTP Authorization request header. (Don't forget to click save!)
  3. Send your requests to the DEV Scrappy Twitter API! 🎉

About

Scrappy Twitter API is a Go-backend project that is secured by the Magic SDK. This Next.js app authenticates the user and gives the access token required to make POST or DELETE requests with the Scrappy Twitter API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published