https://github.com/orbit-apps/elixir-segment-api
Elixir Segment API
https://github.com/orbit-apps/elixir-segment-api
library
Last synced: 4 months ago
JSON representation
Elixir Segment API
- Host: GitHub
- URL: https://github.com/orbit-apps/elixir-segment-api
- Owner: orbit-apps
- Created: 2019-01-24T00:01:52.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2026-01-30T14:08:23.000Z (5 months ago)
- Last Synced: 2026-01-31T07:20:48.385Z (5 months ago)
- Topics: library
- Language: Elixir
- Size: 121 KB
- Stars: 1
- Watchers: 15
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SegmentAPI
Basic HTTP wrapper for the Segment service.
## Installation
Package can be installed by adding `segment_api` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:segment_api, github: "pixelunion/elixir-segment-api", tag: "v0.4.0"}
]
end
```
Add the following configuration to your config.ex
```elixir
config :segment_api, :api_key, ""
```
Uses Jason for json transcoding by default, if you want to configure it to use Poison add the following.
```elixir
config segment_api, json_library, Poison
```
Use like
```elixir
app_slug = "USO"
shopify_domain = "example.myshopify.com"
type = :customer_data_request
SegmentAPI.track(
SegmentAPI.event(app_slug, type),
shopify_domain,
%{data: %{foo: "bar"}},
%{integrations: %{All: true, Salesforce: false}}
)
```