HexWan30 (HexWan30 v0.1.1)

Copy Markdown View Source

Small helpers for generating tracked wan30.video URLs and validating lightweight integrations.

Summary

Functions

Builds a campaign URL with standard UTM parameters.

Builds an embeddable URL under /embed.

Builds a shareable URL with optional campaign metadata.

Builds a referral URL using the ref query parameter.

Produces a SHA-256 HMAC signature for webhook payloads.

Builds a URL for a path under wan30.video.

Verifies a webhook payload against an expected signature.

Returns the canonical website URL.

Functions

campaign_url(path \\ nil, params)

@spec campaign_url(
  String.t() | nil,
  keyword()
) :: String.t()

Builds a campaign URL with standard UTM parameters.

Supported keys: :source, :medium, :campaign, :term, :content

embed_url(asset_id, opts \\ [])

@spec embed_url(
  String.t(),
  keyword()
) :: String.t()

Builds an embeddable URL under /embed.

Example: embed_url("demo-video", autoplay: true)

generate_share_url(path \\ nil, params \\ [])

@spec generate_share_url(
  String.t() | nil,
  keyword()
) :: String.t()

Builds a shareable URL with optional campaign metadata.

Supported params: :ref, :source, :medium, :campaign

referral_url(ref, path \\ nil)

@spec referral_url(String.t(), String.t() | nil) :: String.t()

Builds a referral URL using the ref query parameter.

sign_webhook(payload, secret)

@spec sign_webhook(binary(), binary()) :: String.t()

Produces a SHA-256 HMAC signature for webhook payloads.

url(path \\ nil)

@spec url(String.t() | nil) :: String.t()

Builds a URL for a path under wan30.video.

Empty and root-like paths both resolve to the website root.

verify_webhook_signature(payload, signature, secret)

@spec verify_webhook_signature(binary(), binary(), binary()) :: boolean()

Verifies a webhook payload against an expected signature.

website_url()

@spec website_url() :: String.t()

Returns the canonical website URL.