RelayClient

Represents a client for the Relay API.

Use this struct to connect and authenticate with a Relay server, managing authorization to call protected endpoints.

Authorization

  • Clients should use the fxa_client::FirefoxAccount::getAccessToken() function to obtain a relay-scoped access token (scope: https://identity.mozilla.com/apps/relay).

  • Then, construct the `RelayClient` with the access token. All requests will then be authenticated to the Relay server via Authorization: Bearer {fxa-access-token}.

  • The Relay server verifies this token with the FxA OAuth /verify endpoint.

  • Clients are responsible for getting a new access token when needed.

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class>)
constructor(noPointer: NoPointer)

This constructor can be used to instantiate a fake object. Only used for tests. Any attempt to actually use an object constructed this way will fail as there is no connected Rust object.

constructor(serverUrl: String, authToken: String?)

Creates a new RelayClient instance.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun acceptTerms()

Creates a Relay user record in the Relay service database.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun createAddress(description: String, generatedFor: String, usedOn: String): RelayAddress

Creates a new Relay mask (alias) with the specified metadata.

Link copied to clipboard
open override fun destroy()
Link copied to clipboard
open override fun fetchAddresses(): List<RelayAddress>

Retrieves all Relay addresses associated with the current account.

Link copied to clipboard
fun uniffiClonePointer(): <Error class: unknown class>