The CCIP JavaScript SDK includes two packages:
ccip-js: A TypeScript library that provides a client for managing cross-chain token transfers that use Chainlink's Cross-Chain Interoperability Protocol (CCIP) routers.ccip-react-components: A set of prebuilt ready-to-use UI components built on top ofccip-js.
Using both packages, you can add a fully featured CCIP bridge to your app that can be styled to match your app design.
To view more detailed documentation and more examples, visit the Chainlink Javascript SDK Documentation.
- Clone the
ccip-javascript-sdkrepo:
git clone https://github.com/smartcontractkit/ccip-javascript-sdk.git-
Run
pnpm install
pnpm buildpnpm dev-exampleIf you want to make changes to the package code, you need to rebuild the packages and make sure package.json file to point to the updated local versions.
Make sure to build the ccip-js package before you build the ccip-react-components package. The React components depend on the JS package.
Follow these steps:
- Build the
ccip-jspackage:
pnpm build-ccip-js- Build the
ccip-react-componentspackage:
pnpm build-components- Update the
ccip-react-componentspackage to use the localccip-jsversion by modifyingpackages/ccip-react-components/package.jsonfile. Replace the@chainlink/ccip-jsdependency with the workspace reference:
"@chainlink/ccip-js": "workspace:*"- Update the
examples/nextjsapp to use both localccip-jsandccip-react-componentsversion by modifyingexamples/nextjs/package.jsonfile. Replace the@chainlink/ccip-jsand@chainlink/ccip-react-componentsdependency with relative path:
"@chainlink/ccip-js": "link:../../packages/ccip-js",
"@chainlink/ccip-react-components": "link:../../packages/ccip-react-components",