UNPKG

@stripe/ui-extension-sdk

Version:

The suite of functionality available to UI extensions in Stripe apps

25 lines (24 loc) 804 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDashboardUserEmail = void 0; const _endpoint_1 = require("./_endpoint"); const httpClient_1 = require("./httpClient"); const getDashboardUserEmail = async () => { try { const resp = await (0, _endpoint_1.getHostEndpoint)().call.stripeApiFetch('/v1/user/email', { headers: { [httpClient_1.AUTHORIZATION_HEADER]: httpClient_1.AUTHORIZATION_VALUE, }, }); if (resp.ok) { resp.email = resp.json.email; return resp; } return Promise.reject(resp); } catch (e) { console.error('Error getting dashboard user email', e); throw e; } }; exports.getDashboardUserEmail = getDashboardUserEmail;