Skip to main content

README.md

# HexWan30

Minimal Elixir helpers for building tracked `wan30.video` 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 wan30.video.

## Installation

Add `hex_wan30` to your list of dependencies in `mix.exs`:

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

## Usage

```elixir
iex> HexWan30.website_url()
"https://wan30.video"

iex> HexWan30.campaign_url("/pricing", source: "hex", medium: "package", campaign: "launch")
"https://wan30.video/pricing?utm_campaign=launch&utm_medium=package&utm_source=hex"

iex> HexWan30.referral_url("creator-42")
"https://wan30.video?ref=creator-42"

iex> HexWan30.generate_share_url("/gallery", ref: "creator-42", source: "hex")
"https://wan30.video/gallery?ref=creator-42&utm_source=hex"

iex> HexWan30.embed_url("demo-video", autoplay: true)
"https://wan30.video/embed?asset=demo-video&autoplay=1"
```

Webhook example:

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

HexWan30.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_wan30`
- Hex links:
  - `https://wan30.video/`
  - `https://github.com/DieselNiu/hex-wan30`

## License

MIT