Coder Social home page Coder Social logo

magiclabs / scrappy-twitter-api-client Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 0.0 750 KB

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.

Home Page: https://scrappy-twitter-api-client-xi.vercel.app/

JavaScript 100.00%
magic-sdk postman authentication user-identity nextjs rest-api

scrappy-twitter-api-client's Introduction

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! 🎉

scrappy-twitter-api-client's People

Contributors

seemcat avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.