README.md

# 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`:

```elixir
    def deps do
      [
        {:hex_wan, "~> 0.1.1"}
      ]
    end
```

## Usage

```elixir
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:

```elixir
payload = ~s({"event":"render.completed"})
signature = HexWan.sign_webhook(payload, "topsecret")

HexWan.verify_webhook_signature(payload, signature, "topsecret")
# true
```

## Documentation

Generate local docs with:

```bash
mix docs
open doc/index.html
```

When the package is published to Hex, the same ExDoc output can be published to
HexDocs with:

```bash
mix hex.publish docs
```

## Publishing

1. Install Elixir and Hex.
2. Run `mix hex.user register` if you do not already have a Hex account.
3. Verify package metadata with `mix hex.build`.
4. Publish with `mix hex.publish`.

Convenience script:

```bash
./publish.sh
```

## Package Metadata

- Package name: `hex_wan`
- Hex links:
  - `https://wan2-7.io/`
  - `https://github.com/DieselNiu/hex-wan`

## License

MIT