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) => {
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