Building a Plugin
SDK Plugins are used to augment traditional Destination and Source components (Subscriptions and Streams) by shipping code to the End User’s Device. You can use this mechanism to enable customers to dynamically include your libraries or SDKs and to wire up the Segment SDK to invoke them directly when your plugin is enabled. This pattern is most commonly used to build what we call “Device-mode Destinations”.
Segment’s Client SDKs (analytics.js, analytics-ios, and analytics-android) serve as “microcosms” of the Segment Customer Data Infrastructure runtime — they enable the dynamic orchestration of event collection, cleaning and validation, transforming, and delivery to collection endpoints right from inside the SDK.
SDK Plugins are an appropriate component for your App if your source or destination requires client-side side effects, such as collecting ambient data in the client (Heatmapping, Error & Performance Monitoring tools), relying on device-native context such as third party cookies (Advertising pixels), or needs to actively modify the Client UI (e.g. A/B testing, Push Notification, In-App Messaging and LiveChat).
Review the steps outlined in the Developer Center Overview. This document outlines specific details for Step 4 as it relates to building a plugin.
- Understand Segment’s Conceptual Model and Spec.
- Follow Segment’s security guidance.
- Request access to the Segment Developer Center.
- Create an App.
- Build and test your Component(s).
- Publish documentation.
- Submit your App for review.
- Launch into Public Beta!
Build & Test
Once you’ve created an App, you’re ready to starting building your Plugin. Refer to the documentation and examples in these repositories to learn how to build and initialize your plugins for the appropriate libraries.
As with all partner contributions, only those which follow the Segment Spec will be approved. Once you’ve finished building your plugin, make sure to reference the above wikis to test your plugin locally. Before reviewing, we’ll need to see a full suite of cross-device tests.
Complete the remaining steps as outlined in the Developer Center Overview
This page was last modified: 09 Sep 2020
Questions? Problems? Need more info? Contact Segment Support for assistance!