v1.0.0
Bridge client
Talk to the TIMES host from inside your iframe.
bun add @times/aip-sdkVanilla
import { createTimesAipClient } from '@times/aip-sdk';
const client = createTimesAipClient({
parentOrigin: 'https://app.times.et',
apiBaseUrl: 'https://api.times.et'
});
const init = await client.waitForInit();
client.setTitle(client.t('meta.name'));
client.ready('1.0.0');
const company = await client.api.company();React
import { AppsBridgeProvider, useAppsInit, useAppsT } from '@times/aip-sdk';
function Root() {
return (
<AppsBridgeProvider client={client}>
<Home />
</AppsBridgeProvider>
);
}
function Home() {
const init = useAppsInit();
const t = useAppsT();
if (!init) return null;
return <h1>{t('home.title')}</h1>;
}Init payload
| Field | Notes |
|---|---|
locale | en, am, om or ti. |
theme, typography, colorMode | Applied automatically when you import tokens.css. |
tenantPublicId | The merchant workspace. |
surface, section | Where you are rendered. |
grantedScopes | Scopes the merchant granted. |
slug, kind | Your catalog identity. |
Client methods
| Method | What it does |
|---|---|
ready(version?) | Hides the host splash. |
setTitle(title) | Sets the host header title. |
toast(message, tone?) | Shows a host toast. |
navigate(section) | Changes the host route inside your app. |
requestScopes(scopes) | Asks for optional scopes. |
close() | Closes an overlay. |
api.* | Typed calls for company, invoices, products, users, state, tickets, HR, connection and settings. |
api.subscribe(topic, cb) | Live events. Requires events:subscribe. |



