
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@riseact/riseact-node-sdk
Advanced tools
Riseact SDK for Node.js to develop Riseact apps.
npm install @riseact/riseact-node-sdk
# or
yarn add @riseact/riseact-node-sdk
Install the following peer dependencies if you don't have them already:
npm install express@^4.18
# or
yarn add express@^4.18
Refer to riseact-app-template-node repo for a complete example of how to use this SDK in a Node.js app.
const RiseactConfig: RiseactConfig = {
// Provide your application ID and secret from Riseact
auth: {
clientId: process.env.CLIENT_ID,
clientSecret: process.env.CLIENT_SECRET,
},
storage: {
// Memory, file or custom storage. For custom, you need to define the adapters
type: 'file',
},
network: {
// The URL of the Riseact API. Use the public URL for production and ngrok URL/tunnel for development.
appPublicUrl: process.env.RISEACT_APP_URL,
},
// Optional: In development, you can define custom paths for the Vite configuration and root directory of your client application.
...(process.env.NODE_ENV === 'development' && {
dev: {
// Provide the path to your Vite configuration file and the root directory of your client application.
viteConfig: {
root: path.join(process.cwd(), '../client'),
configFile: path.join(process.cwd(), '../client/vite.config.ts'),
},
},
}),
};
async function createServer() {
const app: Express = express();
// Create the Riseact SDK instance with the client ID and client secret generated from Riseact
const riseact = await initRiseactSDK(RiseactConfig);
// Creare a public router for public endpoints
const publicEpsRouter = express.Router();
publicEpsRouter.use(
riseact.network.registerWebhook(WebhookEventTopic.SupporterCreated, (data) => {
console.log('Webhook received', data);
}),
);
// Create a protected router for private endpoints (request inside Riseact Admin iframe)
const privateEpsRouter = express.Router();
privateEpsRouter.get('/api/hello', (req, res) => {
res.send('Hello World!');
});
privateEpsRouter.get('/api/organization-info', OrganizationInfoHandler(riseact));
privateEpsRouter.get('/api/organization-credentials', OrganizationCredentialsHandler());
// Start the Riseact app
riseact.utils.startRiseactApp(app, riseact, {
publicRouter: publicEpsRouter,
protectedRouter: privateEpsRouter,
serverPort: process.env.SERVER_PORT ? parseInt(process.env.SERVER_PORT) : 3000,
});
}
createServer();
For information about the Riseact GQL Schema, explore it yourself with ApolloStudio typing https://core.riseact.org/admin/graphql/
const ORGANIZATION_INFO_QUERY = graphql(`
query GetOrganizationInfo {
organization {
name
logo {
square
}
}
}
`);
export const OrganizationInfoHandler = async (req, res) => {
// Create a GraphQL client for the user's organization
const graphqlClient = await req.riseact.network.createGqlClient(req.organizationDomain);
// Get the organization type from the common package
const { data, error } = await graphqlClient.query<OrganizationInfoResponseQuery>({
query: ORGANIZATION_INFO_QUERY,
});
if (error) {
return res.status(500);
}
// Return the organization data
res.json({
name: data.organization.name,
logoUrl: data.organization.logo?.square,
});
}
Authentication Architecture
Actors
Auth flow
Requests flow from the client
Authorization: Bearer <access_token>.Transparent token-renewal loop
refresh_token.access_token.Two query surfaces available
Frontend → App Backend → Riseact
Backend-only queries
authMiddleware secures every request originating from the Riseact Admin iframe, which always appends __organization=<org-domain> to the URL.
The auth middleware does the following:
Intercept the /oauth/authorize route
__organization is absent.redirect_uri from the appPublicUrl provided in configurationclient_id, client_secret, and the computed redirect_uri.code_verifier via openid-client.X-Riseact-Sdk-Code-Verifier that stores the code_verifier and the organization domain.Intercept the /oauth/callback route
X-Riseact-Sdk-Code-Verifier cookie (returns 401 if missing).code_verifier against the code_challenge. If invalid returns 403.access_token, refresh_token, and expires_in from the query string.expires_at from expires_in + now().client_token.{ access_token, refresh_token, client_token, expires_in, expires_at, organization_domain } in the storage.All other routes
X-Riseact-Sdk-Token cookie; if absent, redirects to /oauth/authorize?__organization=<org-domain>.client_token and organization_domain.client_token; if missing, redirects to authorize.organization_domain matches the stored record; if mismatch, redirects to /authorizereq.organizationDomain and calls next().| Field | Purpose |
|---|---|
access_token | Bearer token for Riseact GraphQL calls |
refresh_token | Used to renew the access token |
client_token | Long-lived identifier for the browser |
expires_in | TTL of the current access token (seconds) |
expires_at | UTC timestamp when the token expires |
organization_domain | Tenant identifier |
createGqlClient consumes these credentials to build an authenticated Apollo client for Riseact. It automatically handles token renewal and retries failed requests.
Riseact backend do not throw errors. If user is not authenticated, it respond with a 200 with this payload:
{
"data": null,
"errors": [
{
"message": "User is not authenticated",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"path"
]
}
]
}
Create a .env file in the root of your project and add the following lines:
CLIENT_ID=<your-app-client-id>
CLIENT_SECRET=<your-app-client-secret>
Run the development server with:
riseact app dev
Now the changes you make to the SDK will be reflected in the dev app.
MIT
FAQs
Riseact SDK for Nodejs
The npm package @riseact/riseact-node-sdk receives a total of 20 weekly downloads. As such, @riseact/riseact-node-sdk popularity was classified as not popular.
We found that @riseact/riseact-node-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.