@circle-apps/sdk
Version:
Official SDK for Celia Mini Apps integration
64 lines (63 loc) • 1.53 kB
TypeScript
export interface MessagePayload<T = any> {
type: string;
payload: T;
callbackId?: string;
error?: string;
}
export interface WrappedMessage {
type: 'FROM_WEBVIEW';
payload: MessagePayload;
}
export interface AuthOptions {
appID: string;
}
export interface AuthResponse {
code: string;
expiresIn?: number;
}
export interface ShareOptions {
title?: string;
message?: string;
url?: string;
dialogTitle?: string;
}
export interface AdOptions {
adUnitId?: string;
type: 'interstitial' | 'rewarded' | 'banner';
testMode?: boolean;
containerId?: string;
size?: string;
requestOptions?: any;
}
export interface BannerAdOptions {
containerId: string;
size?: string;
unitId?: string;
requestOptions?: any;
}
export interface AdResponse {
type: string;
adUnitId?: string;
revenue?: number;
currency?: string;
completed?: boolean;
containerId?: string;
size?: string;
success?: boolean;
hidden?: boolean;
}
export interface LanguageResponse {
language: string;
}
export interface CeliaMiniSDK {
authenticate(options: AuthOptions): Promise<AuthResponse>;
share(options: ShareOptions): Promise<void>;
showAd(options: AdOptions): Promise<AdResponse>;
showBannerAd(options: BannerAdOptions): Promise<AdResponse>;
hideBannerAd(options: {
containerId: string;
}): Promise<AdResponse>;
getLanguage(): Promise<LanguageResponse>;
isInitialized: boolean;
isWebView: boolean;
}