mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 10:53:24 +00:00
Update README with secret field documentation
- Document secret parameter in offer creation examples - Add Protected Offers section with detailed usage - Update API reference for create() and answer() methods - Show hasSecret flag in discovery responses 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ export interface CreateOfferRequest {
|
||||
sdp: string;
|
||||
topics: string[];
|
||||
ttl?: number;
|
||||
secret?: string;
|
||||
}
|
||||
|
||||
export interface Offer {
|
||||
@@ -18,6 +19,8 @@ export interface Offer {
|
||||
createdAt?: number;
|
||||
expiresAt: number;
|
||||
lastSeen: number;
|
||||
secret?: string;
|
||||
hasSecret?: boolean;
|
||||
answererPeerId?: string;
|
||||
answerSdp?: string;
|
||||
answeredAt?: number;
|
||||
@@ -221,14 +224,14 @@ export class RondevuOffers {
|
||||
/**
|
||||
* Answer an offer
|
||||
*/
|
||||
async answer(offerId: string, sdp: string): Promise<void> {
|
||||
async answer(offerId: string, sdp: string, secret?: string): Promise<void> {
|
||||
const response = await this.fetchFn(`${this.baseUrl}/offers/${encodeURIComponent(offerId)}/answer`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: RondevuAuth.createAuthHeader(this.credentials),
|
||||
},
|
||||
body: JSON.stringify({ sdp }),
|
||||
body: JSON.stringify({ sdp, secret }),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user