HexWan
Minimal Elixir helpers for building tracked wan2-7.io links and basic
integration utilities.
This package is intentionally small but functional: it gives Elixir projects a simple way to generate canonical landing URLs, UTM-tagged campaign links, referral links, embed links, and verify webhook signatures for wan2-7.io.
Installation
Add hex_wan to your list of dependencies in mix.exs:
def deps do
[
{:hex_wan, "~> 0.1.1"}
]
endUsage
iex> HexWan.website_url()
"https://wan2-7.io"
iex> HexWan.campaign_url("/pricing", source: "hex", medium: "package", campaign: "launch")
"https://wan2-7.io/pricing?utm_campaign=launch&utm_medium=package&utm_source=hex"
iex> HexWan.referral_url("creator-42")
"https://wan2-7.io?ref=creator-42"
iex> HexWan.generate_share_url("/gallery", ref: "creator-42", source: "hex")
"https://wan2-7.io/gallery?ref=creator-42&utm_source=hex"
iex> HexWan.embed_url("demo-video", autoplay: true)
"https://wan2-7.io/embed?asset=demo-video&autoplay=1"Webhook example:
payload = ~s({"event":"render.completed"})
signature = HexWan.sign_webhook(payload, "topsecret")
HexWan.verify_webhook_signature(payload, signature, "topsecret")
# trueDocumentation
Generate local docs with:
mix docs
open doc/index.htmlWhen the package is published to Hex, the same ExDoc output can be published to HexDocs with:
mix hex.publish docsPublishing
- Install Elixir and Hex.
-
Run
mix hex.user registerif you do not already have a Hex account. -
Verify package metadata with
mix hex.build. -
Publish with
mix hex.publish.
Convenience script:
./publish.shPackage Metadata
-
Package name:
hex_wan -
Hex links:
https://wan2-7.io/https://github.com/DieselNiu/hex-wan
License
MIT