Appstitch
Appstitch connects the most powerful SaaS tools for your app. Build faster and securely
Appstitch Core is required for all integrations. It is used to initialize an app client.
Install
npm install @appstitch/core
Install Peer Dependency Appstitch Types
npm install @appstitch/types
Usage
Initialize Appstitch in your root file
import appstitch from "@appstitch/core";
appstitch.initialize({
appStitchKey:"your_stitch_key",
clientID : "your_client_id"
url : "custom.domain.com" // Only required for paid plans
});
Authentication
User authentication protects your integrations from abuse. Once a user has logged in and recieves a token, the token be be set like this
appstitch.setAuthToken("abc123");
Tokens can be created in two ways
Appstitch Authenthication
The Appstitch Auth library can be used for passwordless user management. Passwordless authentication reduces the friction for users to sign up and ensures only users with valid emails can use your app!
Custom Authentication
A token/GUID can be created with Firebase Auth or youw own user management flow. You need to create callback to verify a valid token. Your authentication callback can be set on the Appstitch dashboard
Sample Callback
app.post("/authCallback", async (req, res) => {
const { body } = req;
const isValid = await verifyToken(body.token)
res.status(200).send({ valid : isValid})
})
Last updated
Was this helpful?