@riseact/nextjs-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.4.4 • Public • Published

Riseact SDK

Next helpers

Configure Riseact

Create a file called [...riseact].js in pages/api/auth. This contains the dynamic route handler for Riseact which will also contain all of your global Riseact configurations.

import { AuthHandler } from "riseact";

export default AuthHandler({
  nextHost: "http://localhost:3000",
  riseactHost: "https://riseact.org",
  clientId: "<your-client-id>",
  clientSecret: "<your-client-secret>",
  errorPagePath: "/error",
  successPagePath: "/",
  callback: async (accessToken, refreshToken) => {
    // do something with the user's credentials
    // if error is thrown, user will be redirected to /error
    await saveCredentials(accessToken, refreshToken);
  },
});

All requests to /api/auth/* (install, redirect) will automatically be handled by Riseact.

Install the app

Visit localhost:3000/api/auth/install

/@riseact/nextjs-sdk/

    Package Sidebar

    Install

    npm i @riseact/nextjs-sdk

    Weekly Downloads

    0

    Version

    1.4.4

    License

    MIT

    Unpacked Size

    30.9 kB

    Total Files

    27

    Last publish

    Collaborators

    • farze
    • jonathanmataloni
    • enodari
    • mtdservices