{"id":22051483,"url":"https://github.com/unboxed-software/anchor-subscriptions","last_synced_at":"2025-07-08T11:05:42.378Z","repository":{"id":65813329,"uuid":"572266265","full_name":"Unboxed-Software/anchor-subscriptions","owner":"Unboxed-Software","description":"A base contract for handling subscription payments on Solana.","archived":false,"fork":false,"pushed_at":"2023-02-20T20:27:08.000Z","size":438,"stargazers_count":33,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-07T17:13:58.133Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Unboxed-Software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-29T22:40:05.000Z","updated_at":"2025-03-22T13:46:09.000Z","dependencies_parsed_at":"2023-07-28T02:31:52.490Z","dependency_job_id":null,"html_url":"https://github.com/Unboxed-Software/anchor-subscriptions","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Unboxed-Software/anchor-subscriptions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fanchor-subscriptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fanchor-subscriptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fanchor-subscriptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fanchor-subscriptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Unboxed-Software","download_url":"https://codeload.github.com/Unboxed-Software/anchor-subscriptions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Unboxed-Software%2Fanchor-subscriptions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264257658,"owners_count":23580469,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T15:09:20.865Z","updated_at":"2025-07-08T11:05:42.369Z","avatar_url":"https://github.com/Unboxed-Software.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plege - On-chain subscriptions\n\nPlege is a Solana-based payments provider dedicated to reaching Web2 feature parity and beyond. This repository hosts our on-chain subscriptions payment program and an accompanying client-side SDK.\n\nThe program is written using Rust and Anchor. Its payment automation works using [clockwork threads](https://docs.clockwork.xyz/about/readme), thus eliminating any reliance on client-side automation.\n\nThe program is currently live on Devnet with program Id `7xMy6CDMk3ANhRBEMorr9A3EJt5qWcQq64MeqGdC9JpA`.\n\nWe will be live on Mainnet-beta shortly.\n\n## Interacting with the Subscriptions Program\n\nThe easiest way to interact with the subscriptions is using the [Typescript SDK](./client/subscription-sdk/).\n\nThis SDK is published as `@plege/subscriptions`. You can bring it into your JS/TS projects using the following:\n\n```ts\nnpm install @plege/subscriptions\n```\n\nTo see an example of how to interact with the program, take a look at our [demo frontend repo](https://github.com/plege-xyz/website-beta).\n\nThe package is broken into three primary namespaces `user`, `app`, and `tier`.\n\n### `user`\n\n`user` exposes basic functionality for creating and fetching a user with the following functions:\n\n* `createUser` - creates a new user\n* `fetchUser` - fetches an existing user\n\nThe corresponding on-chain account is of type `UserMeta` and represents an authority under which multiple subscriptions apps can be created.\n\n### `app`\n\n`app` exposes functionality for creating and interacting with subscriptions apps. The corresponding account on-chain is `App`. It can be thought of as a way to bundle related subscriptions so you can easily identify what to serve up to subscribers. \n\nThrough the `app` namespace you have the following:\n\n* `create` - creates a new app\n* `fetch` - fetches an existing app\n* `get.subscriptions.all` - gets all active subscriptions to a given app\n* `get.subscriptions.count` - gets a count of all the active subscriptions to a given app\n* `get.subscriptions.groupedByTier` - gets all active subscriptions to a given app grouped by their tier\n* `get.tiers.all` - gets all tiers for a given app\n* `get.tiers.count` - gets the tier count for a given app\n\n### `tier`\n\nTiers are a owned by apps. This allows flexibility in how you design your subscriptions. For example, you can create a tier that represents a base level monthly membership and another that represents a base level yearly membership.\n\nThis namespace surfaces the following:\n\n* `create` - creates a new tier belonging to a given app\n* `fetch` - fetches an existing tier\n* `pauseTier` - pauses new subscriptions to a given tier\n* `unpauseTier` - allows new subscriptions to a previously paused tier\n* `disable` - permanently disables a tier. Note that this makes it so no new subscribers can subscribe to this tier and also terminates all existing subscriptions to that tier.\n* `get.subscriptions.all` - gets all active subscriptions to a given tier\n* `get.subscriptions.count` - gets a count of all active subscriptions to a given tier\n\n## Referral program\n\nIn addition to our subscription program, we've created a referral program that builds on top of our subscription program. This program allows merchants to split payments among multiple parties, one of which is a \"referral agent.\"\n\nWhile this can be flexible, you can think of a referral agent as a brand ambassador who receives \"commission\" for making a sale. In Web2, it's like giving a podcaster a referral code it share with listeners. When a listener uses the referral code to subscribe, the podcaster gets a cut.\n\nThis program will be released with the week.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funboxed-software%2Fanchor-subscriptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funboxed-software%2Fanchor-subscriptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funboxed-software%2Fanchor-subscriptions/lists"}