1.1.0 • Published 2 years ago

@quangas/auth-js v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Stytch SDK as an ES Module

Use the Stytch SDK as an ES module. You might want to use this library if you want to use the SDK with a Javascript bundler, but aren't using the Stytch React library. If you want to use the SDK with plain HTML, include https://js.stytch.com/stytch.js as a source directly, like we do here.

npm version Slack Link

Installation

npm install @stytch/stytch-js

Usage

loadStytch

This function returns a Promise that resolves with a newly created window.Stytch once the SDK has loaded. If you call loadStytch in a server environment - for example during server-side rendering - it will resolve to null.

import {loadStytch} from '@stytch/stytch-js';

const Stytch = await loadStytch();

Stytch('public-token-test-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
  .mount({
    elementId: "#magic-link",
    loginOrSignupView: {
      products: ['emailMagicLinks', 'oauth'],
      emailMagicLinksOptions: {
        loginRedirectURL: "https://example.com/authenticate",
        loginExpirationMinutes: 30,
        signupRedirectURL: "https://example.com/authenticate",
        signupExpirationMinutes: 30,
        createUserAsPending: true,
      },
      oauthOptions: {
        providers: [{ type: 'google' }, { type: 'microsoft' }, { type: 'apple' }],
        loginRedirectURL: "https://example.com/authenticate",
        signupRedirectURL: "https://example.com/authenticate",
      }
    }
  });

For more information on how to use the Stytch SDK, please refer to the docs.

See Also

Changelog

2.0.3 - 2020-9-5

  • Added type definitions for Apple OAuth

2.0.2 - 2020-8-25

  • Added type definitions for the OAuth product
1.1.0

2 years ago

1.0.52

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.31

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago