TypeScript typings for Firebase Dynamic Links API v1
Programmatically creates and manages Firebase Dynamic Links.
For detailed description please check documentation.
Installing
Install typings for Firebase Dynamic Links API:
npm install @types/gapi.client.firebasedynamiclinks@v1 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load('client', () => {
});
Then load api client wrapper:
gapi.client.load('firebasedynamiclinks', 'v1', () => {
});
Don't forget to authenticate your client before sending any request to resources:
var client_id = '',
scope = [
'https://www.googleapis.com/auth/firebase',
],
immediate = true;
gapi.auth.authorize(
{ client_id: client_id, scope: scope, immediate: immediate },
authResult => {
if (authResult && !authResult.error) {
} else {
}
});
After that you can use Firebase Dynamic Links API resources:
await gapi.client.firebasedynamiclinks.managedShortLinks.create({ });
await gapi.client.firebasedynamiclinks.shortLinks.create({ });
await gapi.client.firebasedynamiclinks.v1.getLinkStats({ dynamicLink: "dynamicLink", });
await gapi.client.firebasedynamiclinks.v1.installAttribution({ });
await gapi.client.firebasedynamiclinks.v1.reopenAttribution({ });