https://github.com/padcom/segment-api
https://github.com/padcom/segment-api
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/padcom/segment-api
- Owner: padcom
- Created: 2021-02-10T13:55:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-10T14:06:16.000Z (over 5 years ago)
- Last Synced: 2025-06-06T03:06:42.273Z (about 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Segment API as module
This is a module that acts as a forwarder to `window.analytics` created by the Segment initializer.
## API
All the methods explained by the client are forwarded to `windows.analytics`. Check out their documentation at https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/
The following has been added to make the initialization configurable:
### `init(key)` - initialize Segment API
The `key` is what you can find in the settings for your source in Segment. It's been extracted as a separate function so that you can initailize it at a time of your choosing rather than as a separate script. The `key` can also be different depending on the application and/or environment you're using.
## Credits
Created by Matthias Hryniszak \. Please let me know if you want to extend it in any way or if you find any bugs.