npm install --save @polywrap/client-js
Use the PolywrapClient constructor to instantiate the client with the default configuration bundle.
import { PolywrapClient } from "@polywrap/client-js";
const client = new PolywrapClient();
Use the @polywrap/client-config-builder-js package to build a custom configuration for your project.
const config = new PolywrapClientConfigBuilder().addDefaults().build();
const client = new PolywrapClient(config);
Invoke a wrapper.
const result = await client.invoke({
uri: "wrapscan.io/polywrap/logging@1",
method: "info",
args: {
message: "Hello World!"
}
});
if (!result.ok) throw result.error;
const value = result.value;
Below you will find a reference of object definitions which can be used to configure the Polywrap client. Please note that the intended way of configuring the client is to use the PolywrapClientConfigBuilder, as explained above.
/**
* Instantiate a PolywrapClient
*
* @param config - a client configuration
*/
constructor(config?: CoreClientConfig)
Generated using TypeDoc