Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace Link

Index

Functions

  • description

    Creates a purchase link, given a product name. Called asynchronously with await. All data is provided as-is from the server, with the addition of an ok boolean for error handling.

    docs

    https://docs.hyper.co/reference/create-link

    example
    import { Client, Link } from 'hyper'
    const client = Hyper('my-api-key')

    let body = {
    plan: "my-product-id"
    }

    const res = await Link.create(client, body)

    Parameters

    Returns Promise<HyperApiResponse>

  • description

    Retrieves a link, given its id. Called asynchronously with await. All data is provided as-is from the server, with the addition of an ok boolean for error handling.

    docs

    https://docs.hyper.co/reference/retrieve-link

    example
    import { Client, Link } from 'hyper'
    const client = Hyper('my-api-key')

    let link = "my-link-id"

    const res = await Product.get(client, link)

    Parameters

    • client: HyperApiClient

      (HyperApiClient) The client to use for the request

    • link: string

      (string) The id of the link to fetch

    Returns Promise<HyperApiResponse>

    HyperApiResponse

  • description

    Updates a link, given its id and new value(s). Called asynchronously with await. All data is provided as-is from the server, with the addition of an ok boolean for error handling.

    docs

    https://docs.hyper.co/reference/update-link

    example
    import { Client, Link } from 'hyper'
    const client = Hyper('my-api-key')

    let link = "my-link-id"

    let body = {
    active: false
    }

    const res = await Link.update(client, link, body)

    Parameters

    • client: HyperApiClient

      (HyperApiClient) The client to use for the request

    • link: string

      (string) The id of the link to update

    • body: LinkBodyUpdate

      (LinkBodyUpdate) An object with the updated key/value pairs provided

    Returns Promise<HyperApiResponse>

    HyperApiResponse

Generated using TypeDoc