Urgent.News

What's breaking now, across thousands of outlets.

Tech

v2hub: an ecosystem for developers

In previous posts I talked about v2hub — an ecosystem for managing VPN subscriptions — and about how I ended up building it . Back then the service was simple: a user has a token, and they use that token to manage their own subscriptions. Through v2hub-cli , through v2hub-panel , through the bot — didn't matter which, the point was the same: a user only ever had the subscriptions they created…

v2hub is an ecosystem designed to help developers manage VPN subscriptions. Initially, the service operated on a simple model where users had tokens to manage their own subscriptions. However, as more developers wanted to build on top of v2hub or integrate it into their products, the current feature set became insufficient. To address this, v2hub introduced the concept of providers.

A provider is a separate account that can manage a user's subscriptions with the user's consent. This provider token is essentially the same as a regular user token but flagged differently on the server side.

When a provider manages a user's subscription, it uses the same v2hub library and methods but with an additional parameter specifying the user it is acting on behalf of. This design allows a single provider to manage subscriptions for multiple users. The consent process is crucial and involves a full authorization lifecycle. The provider requests access, and if the user exists in the system, a pending request is shown to them.

If the user doesn't exist, an HMAC-signed invite link is generated, which the user can follow to create an account and approve the connection request.

Each provider has its own isolated space to manage subscriptions, and it cannot access subscriptions created by the user themselves. If a user revokes a provider, the provider can't delete the subscriptions but can stop managing them. The user can reconnect a provider anytime, and everything becomes available again. There is also a limit on the number of providers a user can connect, typically five by default.

If a user exceeds this limit, they must revoke one of the existing providers before connecting another. This limit prevents users from overloading their accounts and reduces request spam. For developers, v2hub simplifies the process of integrating VPN access by providing a backend for aggregating configurations, storing subscriptions, and handling nested references.

Developers can create subscriptions, add or remove sources, and provide the user with a public subscription link, all without storing any data on their end.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Thursday 10 September →