### Quick Start: Clone, Install, and Run Dev Server Source: https://github.com/afftester/affeasy/blob/main/README.md Quick start commands to clone the repository, install dependencies, and start the development server. ```bash # Clone the repository git clone https://github.com/afftester/afftester.git # Install dependencies cd afftester npm install # Start the development server npm run dev ``` -------------------------------- ### Install @dub/ui with pnpm Source: https://github.com/afftester/affeasy/blob/main/packages/ui/README.md Use this command to install the @dub/ui package in your project. It requires pnpm as the package manager. After installation, you can import the components in your React application. ```bash pnpm i @dub/ui ``` -------------------------------- ### Install @dub/utils with pnpm Source: https://github.com/afftester/affeasy/blob/main/packages/utils/README.md Install the @dub/utils package using pnpm. ```bash pnpm i @dub/utils ``` -------------------------------- ### Create a password-protected link with the AffEasy API Source: https://github.com/afftester/affeasy/blob/main/apps/docs/features/password-protected-links.mdx Use the AffEasy SDK to create a link with a password. The customDomain property is optional. This example is for developers and advanced users. ```typescript import { AffEasy } from "affeasy"; const affeasy = new AffEasy(); await affeasy.links.create({ url: "https://example.com/confidential", password: "secretpass123", customDomain: "go.yourbrand.com", // optional }); ``` -------------------------------- ### Create a cloaked link with the AffEasy API Source: https://github.com/afftester/affeasy/blob/main/apps/docs/features/link-cloaking.mdx Use the AffEasy API to programmatically create a cloaked link. Requires the 'affeasy' package and a Pro plan. The 'cloaking' option enables link cloaking, and 'customDomain' is optional for using a custom subdomain. ```typescript import { AffEasy } from "affeasy"; const affeasy = new AffEasy(); await affeasy.links.create({ url: "https://example.com/long-url", cloaking: true, customDomain: "go.yourbrand.com", // optional }); ``` -------------------------------- ### Create a link with expiration using AffEasy API Source: https://github.com/afftester/affeasy/blob/main/apps/docs/features/link-expiration.mdx Use the AffEasy API to create a link with an expiration date and a custom expiration URL. The `expiresAt` field sets the expiration timestamp, and `expirationUrl` defines where users are redirected after expiration. ```typescript import { AffEasy } from "affeasy"; const affeasy = new AffEasy(); await affeasy.links.create({ url: "https://example.com/limited-offer", expiresAt: "2024-12-31T23:59:59Z", expirationUrl: "https://example.com/offer-ended", }); ``` -------------------------------- ### Create a geo-targeted link with the AffEasy API Source: https://github.com/afftester/affeasy/blob/main/apps/docs/features/geo-targeting.mdx Use this snippet to create a geo-targeted link via the AffEasy API. The `geo` field must use valid ISO 3166-1 alpha-2 country codes as keys and their respective URLs as values. The `url` field serves as the fallback for non-targeted locations. ```typescript import { AffEasy } from "affeasy"; const affeasy = new AffEasy(); await affeasy.links.create({ url: "https://example.com", // fallback URL geo: { US: "https://example.com/us", GB: "https://example.com/uk", DE: "https://example.com/de", }, }); ```