# Cloud Spanner API - Class Google::Cloud::Spanner::Credentials (v2.36.0)

2.36.0 (latest) 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.1 2.18.1 2.17.0 2.16.1 2.15.0 2.14.0 2.13.0 2.12.1 2.11.0 Reference documentation and code samples for the Cloud Spanner API class Google::Cloud::Spanner::Credentials.

## Credentials

Represents the authentication and authorization used to connect to the
Spanner API.

## Inherits

- Google::Cloud::Spanner::V1::Spanner::Credentials

## Example

```ruby
require "google/cloud/spanner"

keyfile = "/path/to/keyfile.json"
creds = Google::Cloud::Spanner::Credentials.new keyfile

spanner = Google::Cloud::Spanner.new(
  project_id: "my-project",
  credentials: creds
)

spanner.project_id #=> "my-project"
```