@integration-app/sdk
Advanced tools
Comparing version 0.0.8 to 0.0.9
{ | ||
"name": "@integration-app/sdk", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "JavaScript SDK for Integration.app", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -20,3 +20,3 @@ import { connectToChild } from 'penpal' | ||
*/ | ||
export async function openIframe(uri: string, callbacks: Callbacks) { | ||
export async function openIframe(uri: string, callbacks: Callbacks = {}) { | ||
if (!initialized) { | ||
@@ -23,0 +23,0 @@ initialized = true |
@@ -27,2 +27,10 @@ import { openIframe } from './iframe' | ||
export function openNewFlow(options: NewFlowOptions) { | ||
const uri = getEmbedUri('flows/new', options, { | ||
blueprintKey: options.blueprintKey, | ||
flowConfig: JSON.stringify(options.flowConfig), | ||
}) | ||
openIframe(uri) | ||
} | ||
function getEmbedUri(page: string, options: InitOptions, params?: any) { | ||
@@ -64,1 +72,6 @@ const key = appKey || options.appKey | ||
} | ||
interface NewFlowOptions extends InitOptions { | ||
blueprintKey: string | ||
flowConfig: any | ||
} |
163567
1313