npm package: @maxim_mazurok/gapi.client.digitalassetlinks-v1
Description: TypeScript typings for Digital Asset Links API v1
Author: Maxim Mazurok
Latest version: 0.2.20260314

# TypeScript typings for Digital Asset Links API v1

Discovers relationships between online assets such as websites or mobile apps.
For detailed description please check [documentation](https://developers.google.com/digital-asset-links/).

## Installing

Install typings for Digital Asset Links API:

```
npm install @types/gapi.client.digitalassetlinks-v1 --save-dev
```

## Usage

You need to initialize Google API client in your code:

```typescript
gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});
```

Then load api client wrapper:

```typescript
gapi.client.load(
  'https://digitalassetlinks.googleapis.com/$discovery/rest?version=v1',
  () => {
    // now we can use:
    // gapi.client.digitalassetlinks
  },
);
```

```typescript
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
gapi.client.load('digitalassetlinks', 'v1', () => {
  // now we can use:
  // gapi.client.digitalassetlinks
});
```

After that you can use Digital Asset Links API resources: <!-- TODO: make this work for multiple namespaces -->

```typescript
/*
Send a bundle of statement checks in a single RPC to minimize latency and service load. Statements need not be all for the same source and/or target. We recommend using this method when you need to check more than one statement in a short period of time.
*/
await gapi.client.digitalassetlinks.assetlinks.bulkCheck({});

/*
Determines whether the specified (directional) relationship exists between the specified source and target assets. The relation describes the intent of the link between the two assets as claimed by the source asset. An example for such relationships is the delegation of privileges or permissions. This command is most often used by infrastructure systems to check preconditions for an action. For example, a client may want to know if it is OK to send a web URL to a particular mobile app instead. The client can check for the relevant asset link from the website to the mobile app to decide if the operation should be allowed. A note about security: if you specify a secure asset as the source, such as an HTTPS website or an Android app, the API will ensure that any statements used to generate the response have been made in a secure way by the owner of that asset. Conversely, if the source asset is an insecure HTTP website (that is, the URL starts with `http://` instead of `https://`), the API cannot verify its statements securely, and it is not possible to ensure that the website's statements have not been altered by a third party. For more information, see the [Digital Asset Links technical design specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md).
*/
await gapi.client.digitalassetlinks.assetlinks.check({});

/*
Retrieves a list of all statements from a given source that match the specified target and statement string. The API guarantees that all statements with secure source assets, such as HTTPS websites or Android apps, have been made in a secure way by the owner of those assets, as described in the [Digital Asset Links technical design specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md). Specifically, you should consider that for insecure websites (that is, where the URL starts with `http://` instead of `https://`), this guarantee cannot be made. The `List` command is most useful in cases where the API client wants to know all the ways in which two assets are related, or enumerate all the relationships from a particular source asset. Example: a feature that helps users navigate to related items. When a mobile app is running on a device, the feature would make it easy to navigate to the corresponding web site or Google+ profile.
*/
await gapi.client.digitalassetlinks.statements.list({});
```

For provenance information see [Provenance section on NPM](https://www.npmjs.com/package/@maxim_mazurok/gapi.client.digitalassetlinks-v1#Provenance:~:text=none-,Provenance,-Built%20and%20signed)