The CCIP JavaScript SDK is a monorepo for 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 React UI components. This package depends onccip-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. Development specific information is also found in individual READMEs inside the ./packages/<<PACKAGE_NAME>> directory.
There is also an example implementation of a front end NextJS app that uses these packages in ./examples/nextjs. That has its own README as well.
- 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. Then:
-
Make sure to build the
ccip-jspackage before you build theccip-react-componentspackage. The React components depend on the JS package. -
Make sure your client's package.json file to points to the updated local versions or use npm link or equivalent in your downstream client code. You can see examples of this in the steps below.
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",Contributions to either repos are welcome! Please open an issue or submit a pull request using the process below.
- Fork the repository.
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ccip-javascript-sdk.git - Navigate to directory:
cd ccip-javascript-sdk - Fetch all branches:
git fetch origin - Switch to develop branch:
git checkout develop - Install dependencies:
pnpm install - Create a feature branch:
git checkout -b feature/my-feature - Commit your changes
- Push to the branch (git push origin feature/my-feature).
- Open a pull request from your fork to the
developbranch of this repo.
🚨 Always branch off from develop when creating your feature branch.