New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@descope/react-sdk

Package Overview
Dependencies
Maintainers
4
Versions
619
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@descope/react-sdk

Descope React SDK

  • 0.0.52-alpha.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by4.17%
Maintainers
4
Weekly downloads
 
Created
Source

@descope/react-sdk

This library lets you consume your login pages created by Descope console-app in your application Under the hood, it uses web-js-sdk

Usage

Install the package

npm install @descope/react-sdk

Render it in your application

Wrap your app with Auth Provider
import { AuthProvider } from '@descope/react-sdk'

const AppRoot = () => {
    return (
        <AuthProvider 
            projectId="myProjectId" 
        >
         <App />
        </AuthProvider>
    )
}
Use Descope to render specific flow

You can use default flows or provide flow id directly to the Descope component

Default flows
// you can choose flow to run from the following
// import { SignIn } from '@descope/react-sdk'
// import { SignUp } from '@descope/react-sdk'
import { SignUpOrIn } from '@descope/react-sdk'

const App = () => {
    return (
        {...}
        <SignUpOrIn 
            onSuccess={(e) => console.log('Logged in!')}
            onError={(e) => console.log('Could not logged in!')}
        />
    )
}
Provide flow id
import { Descope } from '@descope/react-sdk'

const App = () => {
    return (
        {...}
        <Descope 
            flowId="myFlowId" 
            onSuccess={(e) => console.log('Logged in!')}
            onError={(e) => console.log('Could not logged in!')}
        />
    )
}

Contributing to this project

In order to use this repo locally

  • Clone this repository
  • Navigate to repository directory
  • Run npm i
  • Edit src/app/index.tsx in the following way
    • Set projectId prop - replace <project-id> with your project id
    • Set flowId prop - Replace <flow-id> (for example - sign-up-or-in)
    • Optional - set a different baseUrl (for example - http://localhost:8000)
  • Run npm run start
  • Go to http://localhost:3000/ and start flow

FAQs

Package last updated on 01 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc