跳到正文

HOST

在 host mint,在页面聊天。

浏览器看不到 SVEDA_EMBED_HOST_API_KEY。后端调用 POST /sveda/embed/token,页面打开 JS 聊天或 iframe。

在 host mint,在页面聊天。

浏览器看不到 SVEDA_EMBED_HOST_API_KEY。后端调用 POST /sveda/embed/token,页面打开 JS 聊天或 iframe。

各语言 SDK 在 host 上 mint sveda_embed_:PHP、Laravel、Python、Node、Ruby、Go、Java、.NET,或无框架的几行 HTTP。

POST /sveda/session

host route

sveda_embed_

token prefix

9

language guides

The problem

A widget that mints tokens in the browser ships your host key. A Vue-only kit leaves PHP and Go hosts rewriting the handshake. The mint belongs on the server, in the language you already run.

Key in the page

SVEDA_EMBED_HOST_API_KEY stays on the sidecar and the host process. The page only receives origin + token.

One handshake

Every SDK returns origin, token, expires_in, appearance. sveda-host.js does not care which backend minted it.

Framework optional

Laravel, Django, Nest, Rails, Spring, ASP.NET are wrappers. PHP, Go, and a static page plus curl still work.

How to connect

Same five steps on every host. The language pages only change the install line and the mint helper.

  1. 1

    Run sveda-server

    Enable embed, set a host API key, and list the page origin in CORS.

  2. 2

    Install or skip

    Language SDK if you have a backend. No framework if you only need HTML plus a tiny POST.

  3. 3

    Match keys

    Host SVEDA_CLIENT_HOST_API_KEY equals sidecar SVEDA_EMBED_HOST_API_KEY.

  4. 4

    Mint on POST

    Expose POST /sveda/session. Return origin, token, expires_in.

  5. 5

    Open chat

    Page buttons data-sveda-open for JS or iframe.

Pick a language

Step-by-step install for each stack, plus a no-framework path.

Related

Pick a host.

Nine step-by-step guides. Same session JSON. Same two chat openers.

Host SDK docs