The default export of the @google-cloud/datastore package is the
Datastore class.
See the Datastore class for client methods and configuration options.
Examples
Install the client library with <a href="https://www.npmjs.com/">npm</a>:
```
npm install --save
```
Import the client library
```
const {Datastore} = require('@google-cloud/datastore');
```
Create a client that uses <a href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application Default Credentials (ADC)</a>:
```
const datastore = new Datastore();
```
Create a client with <a href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit credentials</a>:
```
const datastore = new Datastore({ projectId:
'your-project-id', keyFilename: '/path/to/keyfile.json'
});
```
include:samples/quickstart.js
region_tag:datastore_quickstart
Full quickstart example:
Members
v1
Properties:
| Name | Type | Description |
|---|---|---|
DatastoreClient |
constructor |
Reference to v1.DatastoreClient. |
- See:
-
- v1.DatastoreClient