GTWY Header

GTWY Embed Integration Guide

#

Bring the Full GTWY Experience into Your App

Why redirect users to another platform when you can bring the entire GTWY experience directly inside your product?

With Embedded GTWY, you can integrate GTWY’s full interface — including agents, configuration tools, model settings, and workflows — directly into your app or website. Your users get the same powerful AI experience without ever leaving your platform.

This guide shows you how to generate your embed token, add the script, customize the embedded UI, and control the GTWY interface programmatically.


#

GTWY Embed Configuration

#

Generate an Embed Token (JWT)

To embed GTWY securely, generate a JWT token.
This token authenticates the embedded instance and ties it to your organization and users.

#

JWT Payload Format

{
  "org_id": "YOUR_ORG_ID",
  "folder_id": "YOUR_FOLDER_ID",
  "user_id": "YOUR_USER_ID"
}
#

Field Explanation

org_id – Your GTWY organization’s unique ID
folder_id – The folder ID assigned for this embed
user_id – A unique identifier for the user (email, UUID, or internal ID)

#

Signing the Token

To sign the token:

  • Find your Access Key under Integration Setup

  • Use this key to sign the JWT payload

  • The signed token ensures that only authorized users can load the embedded interface


#

Embed GTWY in Your Product

Add the following script wherever you want GTWY to appear in your application.

<script
  id="gtwy-main-script"
  src="https://app.gtwy.ai/gtwy.js"
  embedToken="YOUR_EMBED_TOKEN"
  defaultOpen="true"
></script>
#

Script Attributes Explained

Attribute

Description

id

Should always be gtwy-main-script

embedToken

Your signed JWT token

src

GTWY embed script URL

defaultOpen

set “true” for default open the gtwy embed


📌

Here’s a real example of how viaSocket has embedded the GTWY interface inside their platform—giving users a seamless, native GTWY experience directly within their app.

Watch how to setup the GTWY Embed :


#

Programmatic Control

You can control the embedded GTWY interface using JavaScript.

// Opens the embedded GTWY window
window.GtwyEmbed.open();

// Closes the embedded GTWY window
window.GtwyEmbed.close();

// Open GTWY with a specific agent
window.GtwyEmbed.open({"agent_id":"your_gtwy_agentid"});

// Creates or navigates to an agent
window.openGtwy({
  "agent_name": "agent name",
  "agent_purpose": "purpose of agent",
  "meta": {"add meta here"}
});

// Create a new agent using purpose
window.GtwyEmbed.sendDataToGtwy({
  "agent_purpose" : "PURPOSE OF YOUR AGENT TO BE CREATED"
});

These functions allow your application to trigger GTWY from buttons, menus, dashboards, or custom workflows.


#

UI Customization

GTWY allows extensive UI configuration so the embedded interface matches your product environment.

window.GtwyEmbed.sendDataToGtwy({
  hideHomeButton: true,
  showGuide: false,
  showConfigType: false,
  agent_name: "New Agent",
  agent_id: "your_agent_id",
  meta: {'Add meta data here'}
});

#

Configure Interface Settings

The embedded interface provides multiple configuration controls that allow you to modify how GTWY appears inside your application.

#

Interface Options

You can enable or disable various interface components including:

  • Show Agent Type on Create Agent

  • Show History

  • Show Config Type

  • Hide Advanced Parameters

  • Hide Create Agent Manually Button

  • Hide Advanced Configurations

  • Hide Pre Tool

  • Show Variables

  • Show Agent Tone

  • Hide Prompt Helper

  • Migrate Prompt

These settings allow you to simplify the UI for your users or expose advanced configuration capabilities depending on your use case.


#

Display Settings

Embedded GTWY also includes display customization options that allow you to adjust how the interface appears.

#

Available Display Controls

  • Hide Profiles

  • Enable Logs

  • Hide All Access

  • Hide Chat Buttons

  • Hide Insights

  • Theme Mode

  • Add Schedule Deploy

These options allow you to customize the user experience and control which sections of the interface remain visible.


#

Model Settings

GTWY supports multiple model providers and allows you to configure them directly within the embedded interface.

Supported model providers include:

  • OpenAI

  • OpenRouter

  • Groq

  • Anthropic

  • Cohere

  • Gemini

  • xAI

You can configure model access and behavior directly through the Model Settings panel.


#

Theme Profile

The Theme Profile section allows you to customize how GTWY visually appears inside your platform.

This includes UI customization options such as:

  • Theme modes

  • Custom interface appearance

  • Branding alignment

This ensures the embedded experience remains consistent with your product’s design.


#

Events

GTWY emits events that allow your application to react to actions inside the embed.

Use the following listener:

<script>
window.addEventListener('message', (event) => {
  if (event.data.type === 'gtwy') {
    console.log('Received gtwy event:', event.data);
  }
});
</script>

#

Agent Events

#

Agent Created Event

Triggered when a new agent is created.

{
  "type": "gtwy",
  "status": "drafted",
  "data": {
    "agent_id": "agentId"
  },
  "message": "Agent created Successfully"
}
#

Details

Field

Description

status: drafted

Indicates the agent is created but not yet published

agent_id

Unique identifier of the created agent

#

When It Fires

  • Immediately after successful agent creation

  • Agent remains in draft mode


#

Agent Published Event

Triggered when an agent is published.

{
  "type": "gtwy",
  "status": "published",
  "data": {
    "name": "Chatbot_1",
    "agent_description": "",
    "agent_id": "agent_id",
    "agent_version_id": "versionId"
  },
  "message": "Agent Published Successfully"
}

#

Configure Embed Options

Option

Description

Show Agent Type on Create Agent

Shows available agent types (Chatbot, API, Trigger, Batch) when creating a new agent.

Show History

Displays conversation history logs inside the embed.

Show Config Type

Shows the configuration type (API, Chatbot, Batch API, etc.) while modifying or creating an agent.

Hide Advanced Parameters

Hides model parameters such as creativity, tool choice, and other tuning options.

Hide Create Agent Manually Button

Removes the manual agent creation option from the embed.

Hide Advanced Configurations

Hides advanced settings like fallback model, guardrails, model-switching logic, etc.

Hide Pre Tool

Hides the pre-tool configuration section.

Default API Keys

Allows setting default API keys at the embed level for pre-configured access.

meta

The metadata you want to save in the agent.

#

Why Use Embedded GTWY?

Embedding GTWY allows you to deliver powerful AI capabilities directly within your own product.

Benefits include:

  • Adding custom AI agents directly into your application

  • Keeping users inside your platform

  • Maintaining consistent branding and UX

  • Providing a complete AI workspace without redirects

  • Allowing users to create, configure, and deploy agents instantly

📌

Folder Limit Control
Limit the access available to the embed by setting a folder limit:

Folders → Actions → Set Folder


#

Final Thoughts

Embedded GTWY transforms your product into a complete AI workspace.

From agent creation and configuration to model management and workflow automation, everything runs seamlessly inside your platform.

Secure. Scalable. Simple to integrate.

Your platform stays in control — while GTWY powers the intelligence behind it. 🚀


On this page
Bring the Full GTWY Experience into Your App
GTWY Embed Configuration
Generate an Embed Token (JWT)
JWT Payload Format
Field Explanation
Signing the Token
Embed GTWY in Your Product
Script Attributes Explained
Programmatic Control
UI Customization
Configure Interface Settings
Interface Options
Display Settings
Available Display Controls
Model Settings
Theme Profile
Events
Agent Events
Agent Created Event
Details
When It Fires
Agent Published Event
Configure Embed Options
Why Use Embedded GTWY?
Final Thoughts