Skip to main content
Link also runs in a browser, on a phone or a computer. Use it from your web app or customer portal. There’s no SDK to install: your server creates a client session and sends the browser to its web_url.
1

Create a client session

Your server creates a client session for your user, as in Get started, scoped to what the user is about to do. Add a redirect_uri to send the user back when they’re done.
2

Send the browser to web_url

The answer’s web_url already holds the client secret. For an action other than add, append the action and its charger. For add at one of the scope’s sites, append site_id.
3

Confirm the outcome

When the user comes back, your server confirms the link session with Get a link session.
server.ts
The parameters go in the URL’s fragment, after #:

The client secret in the URL

Browsers never send a URL’s fragment to a server, so the secret doesn’t reach server logs or a Referer header. The hosted flow reads it and removes it from the address bar at once. If the user reloads the page, the link session carries on. In a browser, Link can’t ask your app for a new secret, as the mobile SDK does. Open web_url within 60 minutes of creating the client session, or the user sees an error. Create a new client session for every visit rather than storing the URL. Once open, a link session lasts up to 6 hours.

When the user is done

With a redirect_uri, the hosted flow sends the browser there, with two query parameters added:
Anyone can type these parameters, so don’t trust them. Read the outcome with Get a link session, and show what it says. Without a redirect_uri, the hosted flow tells the user they can close the page.
A redirect_uri must be on your integration’s allow-list. To add one, email support@plugchoice.com.

What works in a browser

A browser can’t join a charger’s Wi-Fi or reach chargers on the local network, so some setups need the mobile SDK. In a browser, the hosted flow only offers what it can do there. Bluetooth in a browser works in Chrome and Edge on Android, Windows, macOS and ChromeOS. It doesn’t work in Safari, so not in any browser on an iPhone, nor in Firefox. There, the hosted flow skips the Wi-Fi step and waits for the charger to come online another way, such as a network cable or a SIM. In Chrome or Edge, the browser asks which device to use: the user taps Connect, then picks the charger, which is named after its Chargepoint ID.