Skip to content

Instantly share code, notes, and snippets.

@antonzy
antonzy / stigg-auth0-login-action.js
Created December 29, 2024 13:50
Stigg for Auth0 Login Action
const ManagementClient = require('auth0').ManagementClient;
const Stigg = require('@stigg/node-server-sdk').Stigg;
const crypto = require('crypto');
/**
* Handler that will be called during the execution of a PostLogin flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
curl --request POST \
--header 'content-type: application/json' \
--header 'X-API-KEY: <USER_API_SERVICE_KEY_OR_JWT_BEARER_TOKEN>' \
--url 'https://api.stigg.io/graphql' \
--data '{
"query": "mutation MergeEnvironment($input: MergeEnvironmentInput!) {\n mergeEnvironment(input: $input) {\n environmentSlug\n taskIds\n }\n}",
"variables": {
"input": {
"destinationEnvironmentName": "SaaStart",
"destinationEnvironmentType": "DEVELOPMENT",