open-index/open-npm huggingface dataset:
npm package: @nest-gcr/logger
Description: NestJS npm package starter
Author: Mathieu Marteau
Latest version: 1.0.17

<h1 align="center"></h1>

<div align="center">
  <a href="http://nestjs.com/" target="_blank">
    <img src="https://nestjs.com/img/logo_text.svg" width="150" alt="Nest Logo" />
  </a>
</div>

<h3 align="center">NestJS Logger for Google Cloud Run</h3>

<div align="center">
  <a href="https://nestjs.com" target="_blank">
    <img src="https://img.shields.io/badge/built%20with-NestJs-red.svg" alt="Built with NestJS">
  </a>
</div>

## Installation

1. Install the dependency
```
yarn add @nest-gcr/logger
```

2. Register the module

```typescript
import { Module } from '@nestjs/common';
import { LoggerModule } from '@nest-gcr/logger';

@Module({
  imports: [LoggerModule]
})
export class AppModule {}
```

## Usage

1. Use it anywhere in your application. You have access to two providers:

```typescript
import { Inject, Injectable } from '@nestjs/common';
import { LOGGER, Logger } from '@nest-gcr/logger'

@Injectable()
export class MyProvider {
  constructor(
    @Inject(LOGGER.PROVIDERS.LOGGER) logger: Logger,
    @Inject(LOGGER.PROVIDERS.REQUEST_LOGGER) requestLogger: Logger
  ) {}
  
  foo () {
    this.requestLogger.debug('Hello World!')
  }
}
```

2. Use the global logger for default nestJS logs:

```typescript
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { rootLogger } from '@nest-gcr/logger';

async function bootstrap() {
  const app = await NestFactory.create(TestModule, {
    logger: {
      ...rootLogger,
      log: (message, parameters) => {
        return rootLogger.info(message, parameters);
      },
      error: (message, parameters) => {
        return rootLogger.error(message, parameters)
      }
    },
  });
  await app.listen(process.env.PORT || 3000);
}

bootstrap();
```

## Configuration on Google Cloud RUN

In order for logs to be correctly logged to Google Cloud Logging from Cloud Run instances, you need to set the following environment variable into your container:

```
LOGGER_DRIVER=gcp
```

## Change Log

See [Changelog](CHANGELOG.md) for more information.

## Contributing

Contributions welcome! See [Contributing](CONTRIBUTING.md).

## Author

**John Biundo (Y Prospect on [Discord](https://discord.gg/G7Qnnhy))**

## License

Licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
npm package: @nest-hero/next-auth
Description: Next-auth.js module for Nest framework (node.js)
Author: duylddev
Latest version: 1.0.3

# Next-auth.js module for Nest framework (node.js)

```
npm install @nest-hero/next-auth
```

## NextAuth side
```typescript
export const authOptions: NextAuthOptions = {
    session: {
        strategy: 'jwt',
    }
}
```

## NestJS side

```typescript
import {NextAuthModule} from '@nest-hero/next-auth';

@Module({
    imports: [
        NextAuthModule.forRoot({
            secret: process.env.NEXTAUTH_SECRET,
            cookieName: 'optional'
        }),
    ],
})
export class AppModule {}
```
```typescript
import { NextAuthGuard, User } from '@nest-hero/next-auth';

@Controller()
export class AppController {

    @UseGuards(NextAuthGuard)
    @Post('/')
    handler(@User() user) {
        return user;
    }
}
```
## Diagram
![img.png](docs/diagram.png)

You can check full example (Nest.JS + Next.JS) at `/exmaple` folder

# Roadmap
- [x] NextAuth jwt strategy
- [ ] NextAuth Options Wrapper
- [ ] NextAuth session table strategy