https://github.com/stone-foundation/stone-js-browser-core
Continuation of HTTP logic for SPA/SSR in Stone.js, handles browser-side requests, responses, and cookies.
https://github.com/stone-foundation/stone-js-browser-core
context-aware csr javascript official-stonejs ssr stone-foundation stonejs stonejs-browser typescript
Last synced: 5 months ago
JSON representation
Continuation of HTTP logic for SPA/SSR in Stone.js, handles browser-side requests, responses, and cookies.
- Host: GitHub
- URL: https://github.com/stone-foundation/stone-js-browser-core
- Owner: stone-foundation
- License: mit
- Created: 2025-01-17T23:08:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-12T04:40:46.000Z (about 1 year ago)
- Last Synced: 2025-06-12T04:55:49.124Z (about 1 year ago)
- Topics: context-aware, csr, javascript, official-stonejs, ssr, stone-foundation, stonejs, stonejs-browser, typescript
- Language: TypeScript
- Homepage: https://stonejs.dev
- Size: 138 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Stone.js - Browser Core
[](https://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/@stone-js/browser-core)
[](https://www.npmjs.com/package/@stone-js/browser-core)

[](https://github.com/stone-foundation/stone-js-browser-core/actions/workflows/main.yml)
[](https://github.com/stone-foundation/stone-js-browser-core/actions/workflows/release.yml)
[](https://sonarcloud.io/summary/new_code?id=stone-foundation_stone-js-browser-core)
[](https://sonarcloud.io/summary/new_code?id=stone-foundation_stone-js-browser-core)
[](./SECURITY.md)
[](https://github.com/stone-foundation/stone-js-browser-core/security/code-scanning)
[](https://github.com/stone-foundation/stone-js-browser-core/network/updates)
[](https://conventionalcommits.org)
Stone.js Browser core provides essential utilities for browser-based applications, including event handling, response management, and cookie operations.
---
## Overview
The `@stone-js/browser-core` package provides the browser-side runtime abstraction for navigation-based applications built with **Stone.js**. It acts as the **client-side continuation** of `@stone-js/http-core`, enabling the same application logic to run across HTTP and browser environments, such as SSR, SPA, and hybrid apps.
This module enables **context-aware event and response handling** in the browser using a unified model of routing, redirection, and cookie control, without managing DOM or UI behavior directly.
## Key Features
- `IncomingBrowserEvent`: Represents navigation-based client-side events (e.g., route changes, link clicks)
- `OutgoingBrowserResponse`: Produces standardized browser responses (HTML updates, cookie headers, etc.)
- `RedirectBrowserResponse`: Emits client-side redirects with full context
- `CookieCollection`: Unified cookie abstraction across HTTP and browser environments
- Designed for **SPA and SSR continuity**, not tied to any frontend library
> [!IMPORTANT]
> This package does **not** manage DOM events or UI interactions. It strictly handles navigation-level behavior in a runtime-agnostic way.
## Installation
```bash
npm install @stone-js/browser-core
```
> \[!IMPORTANT]
> This package is **pure ESM**. Ensure your `package.json` includes `"type": "module"` or configure your bundler appropriately.
## Usage Example
```ts
import { IncomingBrowserEvent, RedirectBrowserResponse } from '@stone-js/browser-core'
const event = new IncomingBrowserEvent({
url: URL.parse(location)
})
const response = RedirectBrowserResponse.to('/dashboard')
```
## Learn More
This package is part of the Stone.js ecosystem, a modern JavaScript framework built around the Continuum Architecture.
Explore the full documentation: https://stonejs.dev
## API documentation
* [API](https://github.com/stone-foundation/stone-js-browser-core/blob/main/docs)
## Contributing
See [Contributing Guide](https://github.com/stone-foundation/stone-js-browser-core/blob/main/CONTRIBUTING.md)