talkie-sync
v0.1.4
Published
TypeScript client library for the [Talkie Sync](https://talkie.oskite.com) cloud API.
Readme
Talkie Sync Client
TypeScript client library for the Talkie Sync cloud API.
Install
npm install talkie-syncUsage
Create a project at talkie.oskite.com to get an API key, then:
import { TalkieClient } from "talkie-sync";
const client = new TalkieClient({
baseUrl: "https://talkie.oskite.com",
apiKey: "your-api-key",
});
// Create a pair (initiator)
const { words, session_id, channel_id } = await client.createPair();
// Claim a pair (matcher)
const { session_id, channel_id } = await client.claimPair("aardvark absurd accrue");
// Send a message
await client.pushMessage(channel_id, "hello");
// Poll for messages
const { messages, next_seq } = await client.pollMessages(channel_id, 0, 25000);
// Or list messages (no polling)
const { messages } = await client.listMessages(channel_id);API
createPair(channelId?, sessionId?)— Create a new pair, returns wordsclaimPair(words)— Claim a pair with wordspushMessage(channelId, payload)— Send a messagepollMessages(channelId, after?, timeout?)— Long-poll for messageslistMessages(channelId, after?)— List messages without pollinggetUser()— Get current user infolistProjects()— List projectsgetConfig()— Get tier configuration
License
MIT
