appgram / docs
Dashboard

EMBED SDK

Embed SDK

Vanilla JavaScript embed for any website. Drop in a single script tag with your project key.

Install
<script src="https://cdn.appgram.dev/appgram.min.js" data-project="YOUR_PROJECT_ID"></script>
Quickstart
<script
  src="https://cdn.appgram.dev/appgram.min.js"
  data-project="YOUR_PROJECT_ID"
></script>
53 symbols8 categoriestypescript

Types

Parameters

argsany[]

Returns

void

AppGram Embed SDK Types

Classes

class

AppGram

Methods

constructor→ AppGram
  • settings: Partial<AppGramSettings>
close→ void

Close the widget

destroy→ void

Destroy the widget and clean up

init→ void

Initialize the widget based on mode

isOpen→ boolean

Check if widget is open

navigate→ void

Navigate to a specific page

  • page: AppGramPage
off→ void

Unsubscribe from events

  • event: AppGramEventType
  • callback: AppGramEventCallback
on→ () => void

Subscribe to events

  • event: AppGramEventType
  • callback: AppGramEventCallback
open→ void

Open the widget (modal mode)

  • page: AppGramPageoptional
ready→ Promise<void>

Wait for the widget to be ready

setTheme→ void

Set theme

  • theme: "light" | "dark"
setUser→ void

Set user data for the embed

  • user: null | AppGramUser

AppGram

Close the widget

Returns

void

Parameters

settingsPartial<AppGramSettings>

Returns

AppGram

Destroy the widget and clean up

Returns

void

Initialize the widget based on mode

Returns

void

Check if widget is open

Returns

boolean

Navigate to a specific page

Parameters

pageAppGramPage

Returns

void

Unsubscribe from events

Parameters

eventAppGramEventType
callbackAppGramEventCallback

Returns

void

Subscribe to events

Parameters

eventAppGramEventType
callbackAppGramEventCallback

Returns

() => void

Open the widget (modal mode)

Parameters

pageAppGramPageoptional

Returns

void

Wait for the widget to be ready

Returns

Promise<void>

Set theme

Parameters

theme"light" | "dark"

Returns

void

Set user data for the embed

Parameters

usernull | AppGramUser

Returns

void

Interfaces

Properties

baseUrlstringoptional

Base URL for self-hosted deployments

buttonIconstringoptional

Custom icon (emoji or SVG url) for floating button

buttonTextstringoptional

Custom text for floating button

containerstringoptional

Container selector for inline mode (CSS selector)

defaultPageAppGramPageoptional

Page to show when widget opens

modeAppGramModeoptional

Display mode for the widget

onClose() => voidoptional

Called when widget is closed

onError(error: Error) => voidoptional

Called on error

onFeedbackSubmit(wish: any) => voidoptional

Called when feedback is submitted

onNavigate(page: string) => voidoptional

Called when user navigates to a different page

onReady() => voidoptional

Called when widget is ready

onTicketCreate(ticket: any) => voidoptional

Called when support ticket is created

onVote(wishId: string, voteCount: number) => voidoptional

Called when user votes on a wish

pagesAppGramPage[]optional

Available pages in the widget

positionAppGramPositionoptional

Position of floating button

projectKeystring

Project key in format 'orgSlug/projectSlug' or UUID

routeFormat"embed" | "p-embed"optional

Route format for UUID projects

showFooterbooleanoptional

Show footer with links

showHeaderbooleanoptional

Show header with title

showNavigationbooleanoptional

Show navigation tabs

themeAppGramThemeoptional

Theme customization

userAppGramUseroptional

Pre-set user data for authenticated users

interface

AppGramTheme

Properties

backgroundColorstringoptional
borderRadiusnumberoptional
primaryColorstringoptional
textColorstringoptional
interface

AppGramUser

Properties

emailstringoptional
idstringoptional
namestringoptional

AppGramSettings

Container selector for inline mode (CSS selector)

Display mode for the widget

Called on error

Parameters

errorError

Returns

void

Called when user navigates to a different page

Parameters

pagestring

Returns

void

Called when user votes on a wish

Parameters

wishIdstring
voteCountnumber

Returns

void

Project key in format 'orgSlug/projectSlug' or UUID

AppGramTheme

AppGramUser

Functions

function

isUUID

Check if project key is a UUID

Parameters

projectKeystring

Returns

boolean

Parse project key into org and project slugs Supports both "org/project" format and UUID format

Parameters

projectKeystring

Returns

object
—