清晰的 SDK
外部客户使用 new ClarityClient({ apiKey }) 带有瞄准Oxy API键.
API密钥即使在为Oxy应用发布时仍保留其外部范围和配额.
自有后端集成使用共享的工作量运输:
import { clarityForOxyService } from '@clarity.surf/sdk/server';
const clarity = clarityForOxyService(oxyServer);
await clarity.search({ query: 'public information' });
oxyServer 呼叫者已经存在 OxyServer。工厂选择克莱蒂的
听众, oxy-service:01a0648b-8d73-70ad-8e67-1c07ddc5eb6e。 。 。 .
Oxy拥有工作量证明,无记名刷新,来源限制和回想.
此整合中没有密钥或范围列表.
前端集成使用当前提供者的 oxyServices数字 :
import { clarityForOxySession } from '@clarity.surf/sdk';
const clarity = clarityForOxySession(oxyServices);
await clarity.experience.list(profileAccountId);
// On the owning component/client's disposal:
clarity.dispose();
链接的传输保留会话切换和刷新. 不读取或复制
http.getAccessToken() 或者用应用程序本地授权逻辑来包装获取.
个人经验书写仍需要经过认证的账号;工作量
身份不选择一个人的账户。 公共和外部客户 API
继续通过 ClarityClient。 。 。 .
工厂是源变更 等待释放。 部署匹配的清晰度 接收器和氧气管理局 API 在使用呼叫器前.
公众阅读完全不需要证书。 发现者的消息每一次都一样 阅读器,所以一个屏幕 没有理由识别任何人(一个相框,一个亭) 与一个客户端一起读取, 构建为无:
import { ClarityClient } from '@clarity.surf/sdk';
const stories = await new ClarityClient().publicNews({ languages: ['es', 'en'], limit: 10 });
const [article] = stories[0]?.articles ?? [];
// article.imageUrl is Clarity's copy of the image; article.imageSeeds, once
// known, are its seed colours (`#rrggbb`, best first) to theme a card with.