Install a library with an AI agent
Show the prompt Install Klaviyo's API client library in this project.
First read https://developers.klaviyo.com/en/docs/install_a_library.md.
Ask me for these before you change anything, unless I've already given them:
- Which part of the project should use the library, if it has more than one language or app.
- For a mobile app: whether I want a mobile SDK for push notifications.
Then:
1. Work out the project's language. For Node, PHP, Python or Ruby, use the matching library from the /api (Stable) list: https://github.com/klaviyo/klaviyo-api-node, https://github.com/klaviyo/klaviyo-api-php, https://github.com/klaviyo/klaviyo-api-python or https://github.com/klaviyo/klaviyo-api-ruby. If the language isn't one of these, stop and tell me.
2. For a mobile app, the SDKs are https://github.com/klaviyo/klaviyo-swift-sdk (iOS), https://github.com/klaviyo/klaviyo-android-sdk (Android) and https://github.com/klaviyo/klaviyo-react-native-sdk (React Native).
3. Read the library's README and install it the way it says, using this project's package manager and dependency files and following its conventions. Take the package name and version from the README; don't guess them.
4. Check whether the project already depends on one of the legacy v1/v2 SDKs listed in the guide. They were retired on June 30, 2024. If it does, tell me which, and point me to the update instructions in that SDK's README. Don't remove it or rewrite code that uses it unless I ask.
5. Don't add an API key to the code. If setup needs one, read it from the environment and keep it out of source control and logs.
When you're done, check that the project installs and builds, and that the library imports. Tell me what you changed.
/api (Stable)
/v1 & /v2 Legacy APIs (Deprecated) | 2022
Legacy v1/v2 APIs & associated SDK retirement date: June 30, 2024
Our Legacy APIs and associated packages are retired as of June 30, 2024. You can find instructions for updating SDKs within the README of each legacy SDK repo below.
/v1 & /v2 Legacy APIs (Deprecated) | 2012 - 2021
Legacy v1/v2 APIs & associated SDK retirement date: June 30, 2024
Our Legacy APIs and associated packages are retired as of June 30, 2024. You can find instructions for updating SDKs within the README of each legacy SDK repo below.
NOTE: /v1 & /v2 Legacy APIs (Deprecated) | 2012 - 2021 SDKs do not support all API operations
If you'd like to continue using a legacy SDK (e.g: for multi-threading/multi-store support as we work on updating this feature), you can make newer API calls that are not in the SDK by making HTTPS requests outright. For help with this, you can reference our language-specific code examples within the API reference , which lists all available operations.
Mobile SDKs
Klaviyo offers mobile SDKs to enable push notifications on your mobile app.
iOS
Android
React Native