UNPKG

@capgo/capacitor-crisp

Version:
443 lines 13.7 kB
{ "api": { "name": "CapacitorCrispPlugin", "slug": "capacitorcrispplugin", "docs": "Crisp Chat SDK Plugin for Capacitor.\nProvides live chat and customer support functionality through Crisp.chat.", "tags": [], "methods": [ { "name": "configure", "signature": "(data: { websiteID: string; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Configuration object", "type": "{ websiteID: string; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Configuration object" }, { "name": "param", "text": "data.websiteID - Your Crisp website ID from dashboard" }, { "name": "returns", "text": "Promise that resolves when configuration is complete" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.configure({ websiteID: 'YOUR_WEBSITE_ID' });\n```" } ], "docs": "Configure the Crisp SDK with your website ID.\nMust be called before using any other methods.", "complexTypes": [], "slug": "configure" }, { "name": "openMessenger", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [ { "name": "returns", "text": "Promise that resolves when messenger opens" } ], "docs": "Open the Crisp messenger chat window.\nShows the chat interface to the user.", "complexTypes": [], "slug": "openmessenger" }, { "name": "setTokenID", "signature": "(data: { tokenID: string; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Token data object", "type": "{ tokenID: string; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Token data object" }, { "name": "param", "text": "data.tokenID - Unique token identifier for the user" }, { "name": "returns", "text": "Promise that resolves when token is set" } ], "docs": "Set a unique token ID for the current user session.\nUsed to identify and restore previous conversations.", "complexTypes": [], "slug": "settokenid" }, { "name": "setUser", "signature": "(data: { nickname?: string; phone?: string; email?: string; avatar?: string; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- User information object", "type": "{ nickname?: string | undefined; phone?: string | undefined; email?: string | undefined; avatar?: string | undefined; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - User information object" }, { "name": "param", "text": "data.nickname - User's display name" }, { "name": "param", "text": "data.phone - User's phone number" }, { "name": "param", "text": "data.email - User's email address" }, { "name": "param", "text": "data.avatar - URL to user's avatar image" }, { "name": "returns", "text": "Promise that resolves when user info is updated" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.setUser({\n nickname: 'John Doe',\n email: 'john@example.com',\n phone: '+1234567890'\n});\n```" } ], "docs": "Set user information for the current session.\nUpdates the user profile visible to support agents.", "complexTypes": [], "slug": "setuser" }, { "name": "pushEvent", "signature": "(data: { name: string; color: eventColor; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Event data object", "type": "{ name: string; color: eventColor; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Event data object" }, { "name": "param", "text": "data.name - Name of the event" }, { "name": "param", "text": "data.color - Color to display event in dashboard" }, { "name": "returns", "text": "Promise that resolves when event is pushed" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.pushEvent({\n name: 'completed_purchase',\n color: 'green'\n});\n```" } ], "docs": "Push a custom event to Crisp.\nUseful for tracking user actions and behavior.", "complexTypes": [ "eventColor" ], "slug": "pushevent" }, { "name": "setCompany", "signature": "(data: { name: string; url?: string; description?: string; employment?: [title: string, role: string]; geolocation?: [country: string, city: string]; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Company information object", "type": "{ name: string; url?: string | undefined; description?: string | undefined; employment?: [title: string, role: string] | undefined; geolocation?: [country: string, city: string] | undefined; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Company information object" }, { "name": "param", "text": "data.name - Company name (required)" }, { "name": "param", "text": "data.url - Company website URL" }, { "name": "param", "text": "data.description - Company description" }, { "name": "param", "text": "data.employment - [title, role] tuple for user's position" }, { "name": "param", "text": "data.geolocation - [country, city] tuple for company location" }, { "name": "returns", "text": "Promise that resolves when company info is set" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.setCompany({\n name: 'Acme Corp',\n url: 'https://acme.com',\n employment: ['CEO', 'Executive'],\n geolocation: ['USA', 'San Francisco']\n});\n```" } ], "docs": "Set company information for the current session.\nAssociates the user with a company in Crisp.", "complexTypes": [], "slug": "setcompany" }, { "name": "setInt", "signature": "(data: { key: string; value: number; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Integer data object", "type": "{ key: string; value: number; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Integer data object" }, { "name": "param", "text": "data.key - Key name for the data field" }, { "name": "param", "text": "data.value - Integer value to store" }, { "name": "returns", "text": "Promise that resolves when data is set" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.setInt({ key: 'user_level', value: 42 });\n```" } ], "docs": "Set a custom integer data field.\nStores numerical data associated with the user session.", "complexTypes": [], "slug": "setint" }, { "name": "setString", "signature": "(data: { key: string; value: string; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- String data object", "type": "{ key: string; value: string; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - String data object" }, { "name": "param", "text": "data.key - Key name for the data field" }, { "name": "param", "text": "data.value - String value to store" }, { "name": "returns", "text": "Promise that resolves when data is set" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.setString({ key: 'subscription_tier', value: 'premium' });\n```" } ], "docs": "Set a custom string data field.\nStores text data associated with the user session.", "complexTypes": [], "slug": "setstring" }, { "name": "sendMessage", "signature": "(data: { value: string; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Message data object", "type": "{ value: string; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Message data object" }, { "name": "param", "text": "data.value - Message text to send" }, { "name": "returns", "text": "Promise that resolves when message is sent" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.sendMessage({ value: 'Hello, I need help!' });\n```" } ], "docs": "Send a message from the user to the chat.\nProgrammatically send a message as if the user typed it.", "complexTypes": [], "slug": "sendmessage" }, { "name": "setSegment", "signature": "(data: { segment: string; }) => Promise<void>", "parameters": [ { "name": "data", "docs": "- Segment data object", "type": "{ segment: string; }" } ], "returns": "Promise<void>", "tags": [ { "name": "param", "text": "data - Segment data object" }, { "name": "param", "text": "data.segment - Segment identifier/name" }, { "name": "returns", "text": "Promise that resolves when segment is set" }, { "name": "example", "text": "```typescript\nawait CrispPlugin.setSegment({ segment: 'premium-users' });\n```" } ], "docs": "Set a user segment for targeting and organization.\nUsed to categorize users in the Crisp dashboard.", "complexTypes": [], "slug": "setsegment" }, { "name": "reset", "signature": "() => Promise<void>", "parameters": [], "returns": "Promise<void>", "tags": [ { "name": "returns", "text": "Promise that resolves when session is reset" } ], "docs": "Reset the Crisp session.\nClears all user data and starts a fresh session.\nUseful when user logs out.", "complexTypes": [], "slug": "reset" }, { "name": "getPluginVersion", "signature": "() => Promise<{ version: string; }>", "parameters": [], "returns": "Promise<{ version: string; }>", "tags": [ { "name": "returns", "text": "Promise with version string" } ], "docs": "Get the plugin version number.", "complexTypes": [], "slug": "getpluginversion" } ], "properties": [] }, "interfaces": [], "enums": [], "typeAliases": [ { "name": "eventColor", "slug": "eventcolor", "docs": "Available colors for Crisp events.\nUsed to visually categorize events in the Crisp dashboard.", "types": [ { "text": "'red'", "complexTypes": [] }, { "text": "'orange'", "complexTypes": [] }, { "text": "'yellow'", "complexTypes": [] }, { "text": "'green'", "complexTypes": [] }, { "text": "'blue'", "complexTypes": [] }, { "text": "'purple'", "complexTypes": [] }, { "text": "'pink'", "complexTypes": [] }, { "text": "'brown'", "complexTypes": [] }, { "text": "'grey'", "complexTypes": [] }, { "text": "'black'", "complexTypes": [] } ] } ], "pluginConfigs": [] }