add ToS to website

This commit is contained in:
jwinterm
2026-02-01 09:13:00 -05:00
parent d70d8f5745
commit b95877ac9c
4 changed files with 415 additions and 94 deletions
+36 -1
View File
@@ -87,12 +87,20 @@ export interface RegisterSocialResponse {
export interface LinkedSocial {
platform: string;
username: string;
username: string | null;
display_name: string | null;
platform_user_id: string | null;
verified: boolean;
verified_at: string | null;
pending_verification: boolean;
}
export interface InitiateLinkResponse {
deep_link: string;
code: string;
expires_at: string;
}
export interface LinkedSocialsResponse {
socials: LinkedSocial[];
}
@@ -119,6 +127,33 @@ export async function registerSocial(
return res.json();
}
/**
* Initiate social link via deep link flow.
*
* Returns a deep link that opens the bot. User clicks the link,
* bot extracts their info automatically, no manual username entry.
*/
export async function initiateLink(
token: string,
platform: string
): Promise<InitiateLinkResponse> {
const res = await fetch(`${API_URL}/api/v1/socials/initiate-link`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
},
body: JSON.stringify({ platform }),
});
if (!res.ok) {
const data = await res.json().catch(() => ({}));
throw new Error(data.error || 'Failed to initiate link');
}
return res.json();
}
export async function getLinkedSocials(token: string): Promise<LinkedSocialsResponse> {
const res = await fetch(`${API_URL}/api/v1/socials/me`, {
headers: { Authorization: `Bearer ${token}` },