Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orbit-apps/elixir-segment-api
Elixir Segment API
https://github.com/orbit-apps/elixir-segment-api
library
Last synced: 10 days 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 (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-12-29T03:00:28.000Z (about 1 year ago)
- Last Synced: 2024-12-07T17:14:02.857Z (2 months ago)
- Topics: library
- Language: Elixir
- Size: 83 KB
- Stars: 1
- Watchers: 15
- Forks: 1
- Open Issues: 7
-
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_requestSegmentAPI.track(
SegmentAPI.event(app_slug, type),
shopify_domain,
%{data: %{foo: "bar"}},
%{integrations: %{All: true, Salesforce: false}}
)
```