Giter Site home page Giter Site logo

dsstewa / stytchjs-react-magic-links Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stytchauth/stytch-react-example

0.0 0.0 0.0 1.46 MB

Example app using the Stytch Javascript SDK, React, and Express

License: MIT License

Shell 11.04% JavaScript 54.11% Python 23.60% CSS 9.50% HTML 1.76%

stytchjs-react-magic-links's Introduction

Stytch React Example App

This example app uses the Stytch React component to send Email Magic Links and a server to authenticate magic links. This repo contains two implementations of the same server written in Node and Python.

In order to use this app, you'll need to build the frontend and start the backend server.

Configure your Stytch credentials

  1. Copy the .env_template to your own .env file (cp .env_template .env)
  2. Fill in the placeholder values for STYTCH_PROJECT_ID, STYTCH_SECRET, and REACT_APP_STYTCH_PUBLIC_TOKEN in your .env file. Get your Stytch API credentials from the API keys in your Stytch dashboard.
  3. Add http://localhost:3000/authenticate as a valid sign-up and login redirect URL on your Stytch Dashboard.
  4. Configure the Stytch JavaScript SDK by visiting the Stytch Dashboard:
    • Add http://localhost:3000 as an authorized domain.
    • Enable the LoginOrCreate option for Email Magic Links.

Quick start

Build the client and run a Node server by running ./quickstart.sh. Run ./quickstart.sh --help to see all the server options.

Visit http://localhost:3000 to see the example app.

Build the client

To build the client by itself, follow these instructions:

  1. Make sure you have node installed: brew install node
  2. Install dependencies: npm install
  3. Build the frontend files from the client directory. Note: You'll need to rebuild your files to reflect any changes you want to make.
    $ cd client
    $ npm run build
    
  4. This example app serves the frontend when you run a backend server. Click on the links under Supported server languages to go to the readme for your preferred language.

Supported server languages

To run the server by itself, navigate to the setup instructions for the backend you want to use:

stytchjs-react-magic-links's People

Contributors

alex-stytch avatar cal-stytch avatar chris-stytch avatar danny-stytch avatar howard-stytch avatar jeremy-stytch avatar julianna-stytch avatar lucy-stytch avatar mary-stytch avatar max-stytch avatar nathan-stytch avatar snyk-bot avatar susie-stytch 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.