serviceEndpoint
Creates a URL object from a service endpoint with additional parameters including the application origin and service-specific parameters. This function is used internally by FCL strategies to construct the complete URL for service communication.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl-core"_10_10fcl.serviceEndpoint(service)
Or import directly the specific function:
_10import { serviceEndpoint } from "@onflow/fcl-core"_10_10serviceEndpoint(service)
Usage
_11// Create URL from service_11const service = {_11 endpoint: "https://wallet.example.com/authn",_11 params: {_11 appName: "MyApp",_11 nonce: "abc123"_11 }_11}_11const url = serviceEndpoint(service)_11console.log(url.toString())_11// https://wallet.example.com/authn?l6n=https://myapp.com&appName=MyApp&nonce=abc123
Parameters
service
- Type:
Service
- Description: The service object containing endpoint and optional parameters
Returns
URL
URL object with all parameters appended as query string parameters