npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rs-tech-hub/nestjs-profile

v1.0.1

Published

A NestJS module to manage user profiles within a NestJS application.

Readme

@rs-tech-hub/nestjs-profile

User profile management for NestJS applications with GraphQL support. Create and update user profiles with personal information, avatar, and demographics.

🔑 License

This package requires a valid commercial license. A valid license key must be configured to use this package.

Visit https://rstechhub.gumroad.com to purchase a license.

✨ Features

  • 👤 Profile Management - Create and update user profiles
  • 🔒 Authentication Required - Protected GraphQL operations
  • 🌍 Demographics - Store country, date of birth, salutation
  • 🖼️ Avatar Support - Profile avatar URL management
  • 📊 GraphQL API - Mutations and queries for profile operations
  • 🔐 User-Scoped - Profiles automatically linked to authenticated users

📋 Prerequisites

  • Node.js ≥ 18
  • TypeScript ≥ 5.1.0
  • NestJS ≥ 11.1.6
  • Prisma ORM v7.0+
  • GraphQL support configured in your NestJS application

📦 Installation

npm install @rs-tech-hub/nestjs-profile \
            @rs-tech-hub/nestjs-auth-core \
            @rs-tech-hub/nestjs-license-validator \
            @rs-tech-hub/nestjs-prisma \
            @rs-tech-hub/nestjs-service-operation
yarn add @rs-tech-hub/nestjs-profile \
         @rs-tech-hub/nestjs-auth-core \
         @rs-tech-hub/nestjs-license-validator \
         @rs-tech-hub/nestjs-prisma \
         @rs-tech-hub/nestjs-service-operation
pnpm add @rs-tech-hub/nestjs-profile \
         @rs-tech-hub/nestjs-auth-core \
         @rs-tech-hub/nestjs-license-validator \
         @rs-tech-hub/nestjs-prisma \
         @rs-tech-hub/nestjs-service-operation

🚀 Module Registration

Import the module in your NestJS application:

import { Module } from '@nestjs/common';
import { ProfileModule } from '@rs-tech-hub/nestjs-profile';

@Module({
  imports: [ProfileModule],
})
export class AppModule {}

📖 GraphQL API

Mutations

Create Profile

mutation {
  profile_create(
    createProfileInput: {
      avatarUrl: "https://example.com/avatar.jpg"
      salutation: "Mr"
      firstName: "John"
      lastName: "Doe"
      dateOfBirth: "1990-01-15"
      country: "United States"
    }
  ) {
    profile {
      id
      avatarUrl
      Salutation
      firstName
      lastName
      dateOfBirth
      country
      userId
    }
  }
}

Update Profile

mutation {
  updateProfile(
    updateProfileInput: {
      avatarUrl: "https://example.com/new-avatar.jpg"
      country: "Canada"
    }
  ) {
    id
    avatarUrl
    country
    userId
  }
}

Queries

Get Current User Profile

query {
  profile_get {
    id
    avatarUrl
    Salutation
    firstName
    lastName
    dateOfBirth
    country
    userId
  }
}

🔧 Repository Usage

Inject the repository in your own services:

import { Injectable } from '@nestjs/common';
import { ProfileRepository } from '@rs-tech-hub/nestjs-profile';

@Injectable()
export class UserService {
  constructor(private profileRepository: ProfileRepository) {}

  async getUserProfile(userId: string) {
    return this.profileRepository.findUnique({ userId });
  }

  async createProfile(data: ProfileCreateDto) {
    return this.profileRepository.create(data);
  }

  async updateProfile(userId: string, data: ProfileUpdateInput) {
    return this.profileRepository.update({ userId }, data);
  }

  async deleteProfile(userId: string) {
    return this.profileRepository.delete({ userId });
  }
}

📝 Data Types

ProfileSalutations Enum

Available salutations for user profiles:

  • MR - Mister
  • MS - Miss
  • MRS - Missus
  • DR - Doctor
  • PROF - Professor

Input Fields

Create Profile Input

| Field | Type | Required | Description | | ----------- | ------ | -------- | ------------------------------- | | avatarUrl | string | ❌ | URL to profile avatar image | | salutation | string | ✅ | User salutation (Mr, Ms, etc.) | | firstName | string | ✅ | User's first name | | lastName | string | ✅ | User's last name | | dateOfBirth | Date | ✅ | User's date of birth (ISO 8601) | | country | string | ✅ | User's country |

Update Profile Input

| Field | Type | Required | Description | | --------- | ------ | -------- | --------------------------- | | avatarUrl | string | ❌ | URL to profile avatar image | | country | string | ❌ | User's country |

All fields are optional in update operations. Only provided fields will be updated.

🔒 Authentication

All GraphQL operations require authentication. The package uses @rs-tech-hub/nestjs-auth-core for JWT authentication:

  • profile_create - Protected with GqlAuthGuard
  • profile_get - Protected with GqlAuthGuard, returns current user's profile
  • updateProfile - Protected with GqlAuthGuard, updates current user's profile
// Authentication is handled automatically
// The current user is injected via @CurrentUser() decorator
@Query(() => [ProfileServiceOutput])
@UseGuards(GqlAuthGuard)
async profile_get(@CurrentUser() user: AuthenticatedUser) {
  // user.sub contains the authenticated user ID
  return this.profileRepository.findUnique({ userId: user.sub });
}

⚠️ Error Codes

| Error Code | Description | | ------------------------------- | ----------------------- | | profile-error:creation-failed | Profile creation failed | | profile-error:update-failed | Profile update failed | | profile-error:not-found | Profile not found |

💡 Best Practices

  1. One Profile Per User: Each user should have exactly one profile
  2. Validate Dates: Ensure dateOfBirth is in valid ISO 8601 format
  3. Avatar URLs: Validate avatar URLs before storing
  4. Country Codes: Use standardized country names or ISO codes
  5. Update Selectively: Only update fields that have changed
  6. Handle Not Found: Gracefully handle cases where profile doesn't exist

📄 License

This package requires a valid commercial license. See LICENSE.txt for details. By using this software, you agree to the terms outlined in the Software License Agreement (SLA.md). The license grants you specific rights to use, modify, and deploy the software within the scope defined in the agreement. For full terms, conditions, and restrictions, please refer to the Software License Agreement.

Release Notes

1.0.0

  • Initial release

1.0.1

  • Fixes profile_get Graphql endpoint
  • Updates profile_update Graphql endpoint
  • Updates internal license handling

🆘 Support

For technical support and inquiries: