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

@23blocks/block-company

v3.2.1

Published

Company block for 23blocks SDK - organizational structure, departments, teams, and quarters

Downloads

2,525

Readme

@23blocks/block-company

Company block for the 23blocks SDK - company settings, departments, teams, and organizational structure.

npm version License: MIT

Installation

npm install @23blocks/block-company @23blocks/transport-http

Overview

This package provides company and organizational management functionality including:

  • Companies - Company settings and configuration
  • Departments - Department hierarchy management
  • Teams - Team management
  • Team Members - Team membership management
  • Quarters - Fiscal quarters and planning periods

Quick Start

import { createHttpTransport } from '@23blocks/transport-http';
import { createCompanyBlock } from '@23blocks/block-company';

const transport = createHttpTransport({
  baseUrl: 'https://api.yourapp.com',
  headers: () => {
    const token = localStorage.getItem('access_token');
    return token ? { Authorization: `Bearer ${token}` } : {};
  },
});

const company = createCompanyBlock(transport, {
  apiKey: 'your-api-key',
});

// Get current company
const currentCompany = await company.companies.getCurrent();
console.log(currentCompany.name, currentCompany.domain);

// List departments
const { data: departments } = await company.departments.list();

Services

companies - Company Management

// List companies
const { data: companies } = await company.companies.list();

// Get company by ID
const companyData = await company.companies.get('company-id');

// Get current company
const current = await company.companies.getCurrent();

// Create company
const newCompany = await company.companies.create({
  name: 'Acme Corp',
  domain: 'acme.com',
  industry: 'Technology',
  size: '100-500',
  timezone: 'America/New_York',
});

// Update company
await company.companies.update('company-id', {
  name: 'Acme Corporation',
  settings: {
    brandColor: '#0066cc',
  },
});

// Delete company
await company.companies.delete('company-id');

departments - Department Management

// List departments
const { data: departments } = await company.departments.list({
  companyId: 'company-id',
});

// Get department by ID
const department = await company.departments.get('department-id');

// Get department hierarchy
const hierarchy = await company.departments.getHierarchy('company-id');

// Create department
const newDepartment = await company.departments.create({
  companyId: 'company-id',
  name: 'Engineering',
  code: 'ENG',
  parentId: null, // Top-level department
  managerId: 'user-id',
});

// Update department
await company.departments.update('department-id', {
  name: 'Software Engineering',
  managerId: 'new-manager-id',
});

// Delete department
await company.departments.delete('department-id');

teams - Team Management

// List teams
const { data: teams } = await company.teams.list({
  departmentId: 'department-id',
});

// Get team by ID
const team = await company.teams.get('team-id');

// Create team
const newTeam = await company.teams.create({
  departmentId: 'department-id',
  name: 'Backend Team',
  description: 'API and infrastructure development',
  leadId: 'user-id',
});

// Update team
await company.teams.update('team-id', {
  name: 'Platform Team',
  leadId: 'new-lead-id',
});

// Delete team
await company.teams.delete('team-id');

teamMembers - Team Member Management

// List team members
const { data: members } = await company.teamMembers.list({
  teamId: 'team-id',
});

// Get member by ID
const member = await company.teamMembers.get('member-id');

// Add team member
const newMember = await company.teamMembers.add({
  teamId: 'team-id',
  userId: 'user-id',
  role: 'developer',
  startDate: '2024-01-15',
});

// Update team member
await company.teamMembers.update('member-id', {
  role: 'senior_developer',
});

// Remove team member
await company.teamMembers.remove('member-id');

quarters - Quarter Management

// List quarters
const { data: quarters } = await company.quarters.list({
  year: 2024,
});

// Get quarter by ID
const quarter = await company.quarters.get('quarter-id');

// Get current quarter
const currentQuarter = await company.quarters.getCurrent();

// Create quarter
const newQuarter = await company.quarters.create({
  companyId: 'company-id',
  name: 'Q1 2024',
  year: 2024,
  quarter: 1,
  startDate: '2024-01-01',
  endDate: '2024-03-31',
});

// Update quarter
await company.quarters.update('quarter-id', {
  goals: ['Launch v2.0', 'Expand to EU market'],
});

// Delete quarter
await company.quarters.delete('quarter-id');

Types

import type {
  Company,
  Department,
  DepartmentHierarchy,
  Team,
  TeamMember,
  Quarter,
  CreateCompanyRequest,
  CreateDepartmentRequest,
  CreateTeamRequest,
  AddTeamMemberRequest,
  CreateQuarterRequest,
} from '@23blocks/block-company';

Company

| Property | Type | Description | |----------|------|-------------| | id | string | Company ID | | name | string | Company name | | domain | string | Company domain | | industry | string | Industry sector | | size | string | Company size range | | timezone | string | Default timezone | | settings | object | Company settings |

Department

| Property | Type | Description | |----------|------|-------------| | id | string | Department ID | | name | string | Department name | | code | string | Department code | | parentId | string | Parent department ID | | managerId | string | Manager user ID |

Team

| Property | Type | Description | |----------|------|-------------| | id | string | Team ID | | name | string | Team name | | description | string | Team description | | departmentId | string | Parent department ID | | leadId | string | Team lead user ID |

Related Packages

License

MIT - Copyright (c) 2024 23blocks