Skip to main content

Third Party Apps

Hot to Integrate my Aplication to Snack Prompt

In order for your platform to be able to provide Snack Prompt information and features to your users, you will need to generate an API Key. Find out how to do this for your users quickly and easily below.

Step 1: Initiate Authentication

  1. Redirect your users to our authentication URL:
https://snackprompt.com/auth/plugin?plugin_name=YOUR_PLUGIN_NAME

Replace YOUR PLUGIN_NAME with a codename that identifies your platform, use only lowercase letters and separated by dashes (kebab-case),

  1. Once the user reaches the platform, he must follow the Sncak Prompt login flow.

Step 2: API Key Generation

After successful authentication:

  1. Our system automatically generates a unique API Key for the user.
  2. The API Key is sent back to your application using window.postMessage().

Step 3: Capture and Use the API Key

  1. In your application, implement a listener to capture the API Key:
// JavaScript sample
window.addEventListener('message', (event) => {
// Verify the origin for security
if (event.origin === 'https://snackprompt.com') {
const { apiKey } = event.data;
// Store the API Key securely
// Use it for subsequent API calls
}
});
  1. Now, your application already has the token needed to connect to all Snack Prompt features.
important

Always store and handle the API Key securely. Never expose it in client-side code or public repositories.