Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions website/docs/agents-sdk/examples/by-complexity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ The most robust agents use **code-driven architecture** where business logic liv
│ Code enforces: │
│ • Business rules │
│ • State management │
│ • Calculations │
│ • Validation │
│ • Calculations │
│ • Validation │
│ • UI updates │
│ │
│ Advantage: LLM only translates intent, code does the rest │
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ Receive notifications about call events:
Status Callback URL: https://your-server.com/status

Events:
Call started
Call answered
Call completed
Call failed
- Call started
- Call answered
- Call completed
- Call failed
```

### Verification Checklist
Expand Down
2 changes: 1 addition & 1 deletion website/docs/browser-sdk/_common/_method_off.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GetListOfAvailableEventsDescription } from "./utils";

**off**(`event`, `fn?`)
- **off**(`event`, `fn?`)

Remove an event handler.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/browser-sdk/_common/_method_on.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GetListOfAvailableEventsDescription } from "./utils";

**on**(`event`, `fn`)
- **on**(`event`, `fn`)

Attaches an event handler to the specified event.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/browser-sdk/_common/_method_once.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GetListOfAvailableEventsDescription } from "./utils";

**once**(`event`, `fn`)
- **once**(`event`, `fn`)

Attaches an event handler to the specified event. The handler will fire only once.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GetListOfAvailableEventsDescription } from "./utils";

**removeAllListeners**(`event?`)
- **removeAllListeners**(`event?`)

Detaches all event listeners for the specified event.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Here is an example of an `Address` object:

### getAddresses

**getAddresses**(`options`): `Promise<{ data: Address[], hasNext, hasPrev }>`
- **getAddresses**(`options`): `Promise<{ data: Address[], hasNext, hasPrev }>`

Returns a list of Addresses.

Expand Down Expand Up @@ -99,7 +99,7 @@ await client.address.getAddresses();

### getAddress

**getAddress**(`options`): `Promise<Address>`
- **getAddress**(`options`): `Promise<Address>`

Get the details of a particular address ID.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Here is an example of a `ConversationChatMessage` object:

### getMessages

**getMessages**(`options`): `Promise<{ data: ConversationChatMessage[], hasNext, hasPrev, nextPage(), prevPage() }>`
- **getMessages**(`options`): `Promise<{ data: ConversationChatMessage[], hasNext, hasPrev, nextPage(), prevPage() }>`

Returns the list of chat messages for a given `addressId`.

Expand All @@ -60,7 +60,7 @@ await client.chat.getMessages({ addressId: "9dbe9e94-c797-461e-b5a3-af6d095deaf4

### subscribe

**subscribe**(`options`): `{cancel()}`
- **subscribe**(`options`): `{cancel()}`

Returns a list of Addresses.

Expand Down Expand Up @@ -91,7 +91,7 @@ cancel();

### sendMessage

**sendMessage**(`options`): `Promise<Conversation>`
- **sendMessage**(`options`): `Promise<Conversation>`

Send a Chat Message to a given Address ID. If no Conversation exists with that Address ID, one will be created.
This is the same function as [`conversation.sendMessage`](/sdks/browser-sdk/signalwire-client/client/conversation#sendmessage).
Expand All @@ -117,7 +117,7 @@ await client.chat.sendMessage({

### join

**join**(`options`): `Promise<JoinConversationResponse>`
- **join**(`options`): `Promise<JoinConversationResponse>`

Joins a conversation given an address without having to send a message. Does nothing if you
were already joined to the conversation. This is the same function as [`conversation.join`](/sdks/browser-sdk/signalwire-client/client/conversation#join).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Here is an example of a `ConversationMessage` object:

### getConversations

**getConversations**(): `Promise<{ data: Conversation[], hasNext, hasPrev }>` -
- **getConversations**(): `Promise<{ data: Conversation[], hasNext, hasPrev }>` -

Returns a list of Conversation objects.

Expand Down Expand Up @@ -96,7 +96,7 @@ await client.conversation.getConversations();

### getConversationMessages

**getConversationMessages**(`options`): `Promise<{ data: ConversationMessage[], hasNext, hasPrev }>`
- **getConversationMessages**(`options`): `Promise<{ data: ConversationMessage[], hasNext, hasPrev }>`

Returns a list of ConversationMessage objects inside a Conversation with an Address ID.

Expand Down Expand Up @@ -145,7 +145,7 @@ await client.conversation.getConversationMessages({

### getMessages

**getMessages**(`options`): `Promise<{ data: ConversationMessage[], hasNext, hasPrev }>`
- **getMessages**(`options`): `Promise<{ data: ConversationMessage[], hasNext, hasPrev }>`

Returns a list of ConversationMessage objects without filtering by Address ID.

Expand Down Expand Up @@ -191,7 +191,7 @@ await client.conversation.getMessages();

### subscribe

**subscribe**(): `Promise<void>`
- **subscribe**(): `Promise<void>`

Subscribe to receive new ConversationMessage objects as they happen.

Expand Down Expand Up @@ -231,7 +231,7 @@ client.conversation.subscribe((conversationMessage) => {

### sendMessage

**sendMessage**(`options`): `Promise<Conversation>`
- **sendMessage**(`options`): `Promise<Conversation>`

Sends a Chat Message to the Conversation. This is the same function as [`chat.sendMessage`](/sdks/browser-sdk/signalwire-client/client/chat#sendmessage).

Expand All @@ -255,7 +255,7 @@ await conversation.sendMessage({

### join

**join**(`options`): `Promise<JoinConversationResponse>`
- **join**(`options`): `Promise<JoinConversationResponse>`

Joins a conversation given an address, without having to send a message. Does nothing if you
were already joined to the conversation. This is the same function as [`chat.join`](/sdks/browser-sdk/signalwire-client/client/chat#join).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function App() {

## **Parameters**

**SignalWire**(`options`): `Promise<SignalWireContract>`
- **SignalWire**(`options`): `Promise<SignalWireContract>`

| Name | Type | Required? | Description |
| :----------------------------- | :----------------------- | :-------- | :---------------------------------------------------------------------- |
Expand Down Expand Up @@ -149,7 +149,7 @@ export default function App() {

### httpHost

`Readonly` **httpHost**: `string`
- `Readonly` **httpHost**: `string`

Returns the URL of the host that the client will use to make HTTP requests (like querying the
list of addresses or conversations).
Expand All @@ -165,7 +165,7 @@ console.log(client.httpHost());

### dial

**dial**(`{to: string, nodeId ?: string}`): `Promise<Call>`
- **dial**(`{to: string, nodeId ?: string}`): `Promise<Call>`

Dials to the address specified in the `to` parameter, and returns a `Call` object if successful.

Expand Down Expand Up @@ -198,7 +198,7 @@ Promise to a Call object that describes the ongoing call, and provides handles f

### online

**online**(`options`): `Promise<Call>`
- **online**(`options`): `Promise<Call>`

Set the client to be online so it can receive call invites via WebRTC.
The call invites can be accepted or rejected as per user input.
Expand Down Expand Up @@ -257,13 +257,13 @@ window.reject = async () => {

### offline

**offline**(): `void`
- **offline**(): `void`

Set the client to be offline so it doesn't receive call invites via WebRTC.

### getSubscriberInfo

**getSubscriberInfo**(): `void`
- **getSubscriberInfo**(): `void`

Get information about the subscriber that is currently logged in.

Expand Down Expand Up @@ -294,15 +294,15 @@ console.log(await client.getSubscriberInfo())

### connect

**connect**()
- **connect**()

Connects to the WebSocket client. SignalWire manages the WebSocket connection
automatically in most cases, so you'll only need to use `connect` in the rare edge
cases when you need to manually manage the connection.

### disconnect

**disconnect**()
- **disconnect**()

Disconnects from the WebSocket client. SignalWire manages the WebSocket connection
automatically in most cases.
Expand All @@ -313,7 +313,7 @@ Nothing

### updateToken

**updateToken**(token:`string`): `Promise<void>`
- **updateToken**(token:`string`): `Promise<void>`

Update the auth token being used by the client.
For example, in case when the old token is about to expire and you have
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /signalwire-client/utils

## `buildVideoElement`

**buildVideoElement**(`options`): `Promise<BuildVideoElementReturnType>`
- **buildVideoElement**(`options`): `Promise<BuildVideoElementReturnType>`

A function that creates and optionally injects a video DOM element for a given Call or Room object.

Expand Down
32 changes: 16 additions & 16 deletions website/docs/browser-sdk/tech-ref/chat/chat-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ await chatClient.publish({

### constructor

**new Client**(`chatOptions`)
- **new Client**(`chatOptions`)

Creates a new Chat client.

Expand All @@ -65,7 +65,7 @@ const chatClient = new Chat.Client({

### disconnect

**disconnect**(): `void`
- **disconnect**(): `void`

Disconnects this client. The client will stop receiving events and you will need to create a new instance if you want to use it again.

Expand All @@ -83,7 +83,7 @@ client.disconnect();

### getAllowedChannels

**getAllowedChannels**(): `Promise<Object>`
- **getAllowedChannels**(): `Promise<Object>`

Returns the channels that the current token allows you to subscribe to.

Expand Down Expand Up @@ -116,7 +116,7 @@ console.log(channels);

### getMemberState

**getMemberState**(`params`): `Promise<{ channels: Record<string, ChatChannelState> }>`
- **getMemberState**(`params`): `Promise<{ channels: Record<string, ChatChannelState> }>`

Returns the states of a member in the specified channels.

Expand Down Expand Up @@ -148,7 +148,7 @@ s.channels.chan1.state; // the state object for chan1

### getMembers

**getMembers**(`params`): `Promise<{ members: ChatMemberEntity[] }>` - See [ChatMemberEntity documentation](/sdks/browser-sdk/chat/member-entity) for more details.
- **getMembers**(`params`): `Promise<{ members: ChatMemberEntity[] }>` - See [ChatMemberEntity documentation](/sdks/browser-sdk/chat/member-entity) for more details.


Returns the list of members in the given channel.
Expand Down Expand Up @@ -177,7 +177,7 @@ m.members[0]; // { id: ..., channel: ..., state: ... }

### getMessages

**getMessages**(`params`): `Promise<{ cursor: PagingCursor; messages: ChatMessageEntity[] }>`
- **getMessages**(`params`): `Promise<{ cursor: PagingCursor; messages: ChatMessageEntity[] }>`


See [PagingCursor documentation](#paginationcursor) and [ChatMessageEntity documentation](/sdks/browser-sdk/chat/message-entity) for more details.
Expand Down Expand Up @@ -245,7 +245,7 @@ const next = await chatClient.getMessages({

### publish

**publish**(`params`): `Promise<void>`
- **publish**(`params`): `Promise<void>`

Publish a message into the specified channel.

Expand Down Expand Up @@ -295,7 +295,7 @@ await chatClient.publish({

### setMemberState

**setMemberState**(`params`): `Promise<void>`
- **setMemberState**(`params`): `Promise<void>`

Sets a state object for a member, for the specified channels. The previous state object will be completely replaced.

Expand Down Expand Up @@ -328,7 +328,7 @@ await chatClient.setMemberState({

### subscribe

**subscribe**(`channels`): `Promise<void>`
- **subscribe**(`channels`): `Promise<void>`

List of channels for which you want to receive messages. You can only subscribe to those channels for which your token has read permission.

Expand Down Expand Up @@ -361,7 +361,7 @@ await chatClient.subscribe(["chan-2", "chan-3"]);

### unsubscribe

**unsubscribe**(`channels`): `Promise<void>`
- **unsubscribe**(`channels`): `Promise<void>`

List of channels from which you want to unsubscribe.

Expand All @@ -386,7 +386,7 @@ await chatClient.unsubscribe(["chan-2", "chan-3"]);

### updateToken

**updateToken**(`token`): `Promise<void>`
- **updateToken**(`token`): `Promise<void>`

Replaces the token used by the client with a new one. You can use this method to replace the token when, for example, it is expiring, in order to keep the session alive.

Expand Down Expand Up @@ -420,7 +420,7 @@ chatClient.on('session.expiring', async () => {

### member.joined

**member.joined**(`member`)
- **member.joined**(`member`)

A new member joined the chat.

Expand All @@ -434,7 +434,7 @@ A new member joined the chat.

### member.left

**member.left**(`member`)
- **member.left**(`member`)

A member left the chat.

Expand All @@ -448,7 +448,7 @@ A member left the chat.

### member.updated

**member.updated**(`member`)
- **member.updated**(`member`)

A member updated its state.

Expand All @@ -462,7 +462,7 @@ A member updated its state.

### message

**message**(`message`)
- **message**(`message`)

A new message has been received.

Expand All @@ -476,7 +476,7 @@ A new message has been received.

### session.expiring

**session.expiring**()
- **session.expiring**()

The session is going to expire. Use the `updateToken` method to refresh your token.

Expand Down
Loading