Elixir package for interacting with RudderStack HTTP API
If available in Hex, the package can be installed
by adding rudder
to your list of dependencies in mix.exs
:
def deps do
[
{:rudder, "~> 0.1.0"}
]
end
client = Rudder.Client.new(write_key: "abc123", data_plane_url: "https://example.com")
Rudder.identify(client, %Rudder.Identity{
user_id: "123",
context: %{ip: '10.81.20.10'},
traits: %{email: user.email }
})
See Docs
Rudder.track(client, %Rudder.Event{
user_id: "123",
name: "Item Sold",
properties: %{revenue: 9.95, shipping: 'Free'}
})
See Docs
Rudder.page(client, %Rudder.Page{
user_id: "123",
name: "Page View",
properties: %{title: "Home", path: "/"}
})
See Docs
Rudder.screen(client, %Rudder.Screen{
user_id: "123",
name: "Screen View",
properties: %{prop1: "5"}
})
See Docs
Rudder.group(client, %Rudder.group{
user_id: "123",
group_id: "group-a",
traits: %{
name: "Company",
industry: "Industry",
employees: 123
},
context: %{
ip: "14.5.67.21"
}
})
See Docs
Rudder.alias(client, %Rudder.Alias{
user_id: "123",
previous_id: "456",
context: %{
traits: %{
trait1: "new-val"
},
ip: "14.5.67.21"
}
})
See Docs
Rudder.merge(client, %Rudder.Merge{
user_id: "123",
merge_properties: [
%{type: "email", value: "someone@example.com"},
%{type: "mobile", value: "+15555552263"}
})
See Docs
Rudder.batch(client, %Rudder.Batch{
items: [
%Rudder.Identity{
user_id: "123",
context: %{ip: '10.81.20.10'},
traits: %{email: user.email }
},
%Rudder.Page{
user_id: "123",
name: "Page View",
properties: %{title: "Home", path: "/"}
}
]
)
See Docs
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/rudder.