
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
nest-google-sheet-connector
Advanced tools
A Google Sheet integration for NestJs.
To use this module you will need:
Access the Google APIs Console while logged into your Google account.
Create a new project and give it a name. Create a new project
Click on ENABLE APIS AND SERVICES
.
Enable Google Sheets API
Find and enable the Google Sheet API
.
Create new credentials to the Google Sheets API
. Select Other UI
from the dropdown and select Application Data
. Then click on the What credentials do I need?
button.
On the next screen, choose a name for your service account, assign it a role of Project
->Editor
, and click Continue
.
The credentials JSON file will be downloaded by your browser.
The credentials file allows anyone to access your cloud resources, so you should store it securely. More information from Google.
Find the downloaded file and rename it to service_account.json
.
npm install --save nest-google-sheet-connector
import { GoogleSheetModule } from 'nest-google-sheet-connector';
@Module({
imports: [
GoogleSheetModule.register(credentials), // credentials is a JSON object downloaded from Google Cloud Platform
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
service_account.json
file and find the client_email
property.Share
button in the top right, and add the email address of the service account as an editor.If you want only to allow the account read access to the spreadsheet, assign it the
Viewer
role instead.
/d
element. So, for example, if the URL of your document is https://docs.google.com/spreadsheets/d/1234567890123abcf/edit#gid=0
, the ID will be 1234567890123abcf
.import { GoogleSheetConnectorService } from '../../lib/nest-google-sheet-connector';
@Injectable()
export class AppService {
constructor(private googleSheetConnectorService: GoogleSheetConnectorService) {}
}
This service contain google sheet providers methods
Google Cloud requires an SSL certificate for API requests. Here is how to certify your local environment under NestJs:
openssl req -x509 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const fs = require('fs');
const keyFile = fs.readFileSync(__dirname + '/../localhost.key');
const certFile = fs.readFileSync(__dirname + '/../localhost.crt');
const app = await NestFactory.create(AppModule, {
httpsOptions: {
key: keyFile,
cert: certFile,
},
});
await app.listen(3000);
}
bootstrap();
FAQs
A Google Sheet integration for NestJs
The npm package nest-google-sheet-connector receives a total of 6,954 weekly downloads. As such, nest-google-sheet-connector popularity was classified as popular.
We found that nest-google-sheet-connector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.