npminstall--save@0xsquid/sdk@2.8.0-beta.0# or higher
Now in your typescript file
import { Squid } from"@0xsquid/sdk";(async () => {// instantiate the SDK with configconstsquid=newSquid({ baseUrl:"https://v2.api.squidrouter.com", integratorId:"your-integrator-id" });// init the SDKawaitsquid.init();console.log("Squid inited");})();
constbaseUrl="https://v2.api.squidrouter.com/v2"// get an integrator-id https://form.typeform.com/to/cqFtqSvXconstintegratorId="<you-integrator-id>"// Set up JSON RPC provider and signerconstprovider=newethers.providers.JsonRpcProvider(<source-chain-rpc-endpoint>);constsigner=newethers.Wallet(<privateKey>, provider);
All Squid widgets follow the same basic installation flow. The Quick Start examples will use the xSwap widget.