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

@initsolusidigital/worksuite-core

v0.7.2

Published

API client, session store, i18n setup and shared composables for the Init Worksuite web apps, shipped as raw source

Readme

@initsolusidigital/worksuite-core

The non-visual layer shared by the Init Worksuite web apps: the axios client and its interceptors, the session and app stores, the i18n instance with its shared dictionary, the Reverb (Echo) client, generic composables, and the few components that depend on them. The package ships raw .js and .vue source, and each app compiles it in its own Vite build.

The source is published so it can be read. Using it requires written permission from PT Init Solusi Digital; the terms are in the LICENSE file included in the package.

Contents

The files mirror the src/ folder of an app, so src/api/axios.js in the package is the file an app used to keep at src/api/axios.js.

| Folder | Files | |---|---| | api/ | axios.js (client, 401/403/maintenance handling), errors.js (normalizeApiError), maintenance.js, legalGate.js, impersonationToken.js | | api/endpoints/ | self-service and platform endpoints: auth, profile, devices, twoFactor, notifications, apps, users, chat, dataTools, customFields, approvals, legal and others | | stores/ | auth.js (session, /auth/me), app.js (dark mode, open popups, sidebar state) | | plugins/ | i18n.js (instance plus shared dictionary), echo.js (Reverb) | | composables/ | useFormSubmit, useFormValidation, useServerTable, useModulePermission, useApps, useNotifications, useChat, useCrossAppLink, useDirtyState, usePreferences, useBarcodeScanner and others | | components/ui/ | AppDatePicker, AppDateTimePicker, AppDateTimeRangePicker, AppPhoneInput, AppCountrySelect, AppCurrencySelect, AppLanguageSwitcher, AppScanBox, AppToastContainer, AppMaintenanceOverlay, AppForceLogoutModal | | utils/ | appUrl, loginRedirect, dateOnly, datetime, formData, maintenanceSignal, appStatus, notificationText, usedBy and others | | data/ | countries, brandIcons, deviceIcons, lucideIcons | | locales/ | id.json, en.json (the shared dictionary, see below) |

Requirements

  • Vue 3.5, vue-router 4, vue-i18n 11, Pinia 3, axios 1, @lucide/vue.
  • @initsolusidigital/worksuite-ui and @initsolusidigital/worksuite-tooling at the same exact version as this package. Several core components are built from ui components.
  • Tailwind CSS v4. The core components use utility classes, so the app's Tailwind build must scan this package.
  • Optional libraries, needed only by the files that import them: laravel-echo and pusher-js (real-time), @vuepic/vue-datepicker and date-fns (date pickers), libphonenumber-js (AppPhoneInput), @vueform/multiselect (selects), simple-icons and @iconify-icons/simple-icons (brand icons).

Installation

npm install --save-exact @initsolusidigital/worksuite-core @initsolusidigital/worksuite-ui @initsolusidigital/worksuite-tooling
  1. Add worksuiteKit() to vite.config.js, first in plugins (see the worksuite-tooling README). Without it the app keeps building its own copies of these files.

  2. Let Tailwind scan the package. In src/style.css:

    @source "../node_modules/@initsolusidigital/worksuite-ui/src";
    @source "../node_modules/@initsolusidigital/worksuite-core/src";
  3. Export the app's own dictionary from src/locales/index.js as { id, en }, and stop creating an i18n instance in the app. The package creates it.

  4. Call configureWorksuite() in src/main.js, before the session is restored:

    import router from './router'
    import i18n from '@/plugins/i18n'
    import messages from '@/locales'
    import { configureWorksuite } from '@initsolusidigital/worksuite-core/setup.js'
    import { useAuthStore } from '@/stores/auth'
    
    configureWorksuite({ router, messages })
    
    const app = createApp(App)
    app.use(createPinia())
    await useAuthStore().restoreSession()
    app.use(router)
    app.use(i18n)

    @/plugins/i18n and @/stores/auth resolve to the package through the plugin. Package files read this configuration when they run, never when they are imported. Calling anything that needs it before configureWorksuite() throws an error that names the missing call.

    An app that handles an expired session itself (for example the sign-in app, which has no identity gate to send the user to) passes onUnauthenticated:

    configureWorksuite({
      router,
      messages,
      onUnauthenticated: ({ next, router }) => router.push({ name: 'login' }),
    })
  5. Delete the app's copies of the files that now come from the package.

  6. Run the installation check from the app root:

    npx worksuite-kit-check

Importing

Apps can keep their existing imports. The plugin redirects @/api/axios, @/stores/auth, @/composables/useFormSubmit and every other path that exists in this package, with or without the file extension, to the package file. Imports of paths the package does not have still resolve to the app's own files.

Direct imports work too:

import api from '@initsolusidigital/worksuite-core/api/axios.js'

Each file resolves to one module id however it is imported. Two ids for one file would load two copies of the auth store or the axios instance, and the app's configuration would end up in the copy the screens do not use.

Translations

The package ships the shared dictionary in locales/id.json and locales/en.json: common (except common.appName, which belongs to each app), notification, lang, launcher, maintenance, dashboard.subApps, activityFields, usedBy, ai and scan. configureWorksuite({ messages }) merges the app's dictionary on top of it, and the app's keys win.

That makes an app key with the same path as a package key an override, and overrides are rarely intended. A sentence fixed in the package never reaches an app that still keeps its own copy of the key. worksuite-kit-check lists every override as a warning; delete the app's copy unless the app really needs different wording.

Environment variables

The package reads import.meta.env, which Vite compiles into each app's own build:

| Variable | Used for | |---|---| | VITE_API_URL, VITE_API_BASE_URL | API base URL. A relative value (/api/v1) means the API is on the same origin. | | VITE_APP_KEY | The app's own key (hub, crm, and so on). Used by the launcher, notification links and the per-app maintenance lock. | | VITE_AUTH_URL | Origin of the sign-in app, for development setups where each app runs on its own port. | | VITE_REVERB_APP_KEY, VITE_REVERB_HOST, VITE_REVERB_PORT, VITE_REVERB_SCHEME | Reverb connection. | | VITE_HUB_URL, VITE_{APP}_APP_URL | Origins of other apps for cross-app links. | | VITE_ERROR_REPORTING | on or off overrides the default of client error reporting (on in production builds only). |

An empty cross-app variable hides the link to that app without any error.

Client error reporting

configureWorksuite() installs utils/errorReporter.js. It reports uncaught errors, unhandled promise rejections, Vue errors (the i18n plugin sets app.config.errorHandler when it is installed) and router errors to POST {VITE_API_URL}/client_errors, where they appear on the platform's error screen.

  • Reporting is on in production builds and off in development, unless VITE_ERROR_REPORTING says otherwise. Apps without VITE_APP_KEY never report.
  • Each report carries the app key, the app version from __APP_VERSION__ (define it in vite.config.js), the error name, message and stack, and the current URL without its query string and hash. Path segments that look like tokens, and route params named like token, link, code, secret or key, are replaced with placeholders before sending.
  • One report per name and message, and at most ten, per page load. The request uses fetch rather than the app's axios instance, so a failing report never reaches the interceptors.
  • Vue errors are still printed with console.error; the handler only adds the report.
  • A chunk that no longer exists after a deploy (vite:preloadError, or a router error such as Failed to fetch dynamically imported module) reloads the page once. A timestamp in sessionStorage (ws:chunk-reload) stops a second reload within a minute, and the same error after that reload is reported like any other.

What worksuite-kit-check reports

For apps that install this package, the check fails when:

  • src/main.js does not call configureWorksuite(). The axios client then has no router, and a 401 throws instead of sending the user to sign in;
  • src/style.css has no @source line for this package, so the core components render without their styles;
  • a copy of a package file is still in the app's src/. The build no longer reads it, so edits to it have no effect;
  • an app file imports a package file through @/… or a relative path, or through a package specifier without its extension. The second form builds correctly but the dev server can load the file twice.

It warns about app translation keys that override package keys. None of these break the build.

Versioning

All @initsolusidigital/worksuite-* packages share one version number. Install them at the same exact version; mixing versions is not supported.