> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/trailbaseio/trailbase/llms.txt
> Use this file to discover all available pages before exploring further.

# License

> TrailBase licensing information and usage guidelines

TrailBase is free and open-source software, licensed under the **Open Software License 3.0 (OSL-3.0)**. Client libraries are dual-licensed under the permissive **Apache-2.0** license.

## TL;DR

<CardGroup cols={2}>
  <Card title="Your App is Safe" icon="shield-check">
    Your application code is NOT subject to copyleft. Build freely.
  </Card>

  <Card title="Modifications Must Share" icon="code-branch">
    If you modify TrailBase itself, share those changes.
  </Card>

  <Card title="Clients are Permissive" icon="unlock">
    Client libraries use Apache-2.0 (no copyleft).
  </Card>

  <Card title="Commercial Use OK" icon="building">
    Use TrailBase in commercial projects freely.
  </Card>
</CardGroup>

<Note>
  We're not lawyers and this is not legal advice. If you have concerns, please reach out or consult legal counsel.
</Note>

## License Overview

### Server: OSL-3.0

The TrailBase server is licensed under the [Open Software License 3.0 (OSL-3.0)](https://opensource.org/licenses/OSL-3.0), an OSI-approved copyleft license.

**What this means:**

✅ **Freely use TrailBase** for any purpose (personal, commercial, etc.)
✅ **Modify TrailBase** and use your modifications
✅ **Deploy TrailBase** on your infrastructure
✅ **Your application code is NOT affected** by copyleft
❌ **Modifications to TrailBase** must be shared under OSL-3.0

### Clients: Apache-2.0

All TrailBase client libraries are dual-licensed under the permissive [Apache-2.0](https://opensource.org/license/apache-2-0) license.

**Client libraries:**

* JavaScript/TypeScript
* Dart/Flutter
* Rust
* C#/.NET
* Swift
* Kotlin
* Go
* Python

**What this means:**

✅ Use in any project (open or closed source)
✅ No copyleft requirements
✅ Modify freely without sharing changes
✅ Commercial use without restrictions

## Why OSL-3.0?

TrailBase uses OSL-3.0 instead of more common copyleft licenses (like GPL or AGPL) due to its **narrower definition of "derivative work"**.

<Accordion title="What is a Derivative Work?">
  OSL-3.0 defines derivative work as **only modifications to TrailBase itself**.

  **Not considered derivative:**

  * Your application connecting to TrailBase over the network
  * Static assets served by TrailBase
  * WASM components running in TrailBase's runtime
  * Using TrailBase as a framework or library

  This is similar to the GPL's classpath exception or LGPL's [linking exception](https://en.wikipedia.org/wiki/GPL_linking_exception).
</Accordion>

<Accordion title="Comparison with Other Licenses">
  | License        | Your App Affected?   | Network Use Triggers Copyleft?      |
  | -------------- | -------------------- | ----------------------------------- |
  | OSL-3.0        | ❌ No                 | ✅ Yes (for TrailBase modifications) |
  | GPL-3.0        | ⚠️ Maybe (if linked) | ❌ No                                |
  | AGPL-3.0       | ⚠️ Maybe (if linked) | ✅ Yes                               |
  | MIT/Apache-2.0 | ❌ No                 | ❌ No (permissive)                   |

  OSL-3.0 combines:

  * Strong copyleft for TrailBase itself (like AGPL)
  * Freedom for applications using it (like LGPL)
  * Network use transparency (like AGPL)
</Accordion>

### Goals of OSL-3.0 for TrailBase

1. **Your freedom**: Build on and around TrailBase without restrictions
2. **Community benefits**: Improvements to TrailBase are shared back
3. **Horizontal mobility**: Reduce lock-in through open source
4. **Sustainability**: Allow some flexibility for project sustainability

## What You Can Do

### ✅ Allowed Without Restrictions

<CardGroup cols={2}>
  <Card title="Use in Production" icon="server">
    Deploy TrailBase for your applications (commercial or non-commercial)
  </Card>

  <Card title="Build Applications" icon="laptop-code">
    Create apps connecting to TrailBase APIs
  </Card>

  <Card title="Serve Assets" icon="file">
    Use TrailBase to serve your frontend code
  </Card>

  <Card title="WASM Components" icon="cube">
    Write custom server-side logic in WASM
  </Card>

  <Card title="Internal Use" icon="building">
    Use within your organization
  </Card>

  <Card title="Client Libraries" icon="book">
    Use client libraries in any project (Apache-2.0)
  </Card>
</CardGroup>

### 📝 Requires Sharing (Copyleft)

If you modify TrailBase itself, you must:

1. **Make source available**: Provide source code to users
2. **Use OSL-3.0**: License modifications under OSL-3.0
3. **Preserve notices**: Keep copyright and attribution notices
4. **Document changes**: Note your modifications

**Examples of modifications requiring sharing:**

* Changing TrailBase's Rust code
* Modifying the admin UI
* Altering API behavior
* Custom builds with different features

**Not considered modifications:**

* Configuration changes
* SQL migrations
* WASM components
* Your application code
* Using TrailBase as-is

<Info>
  If you're improving TrailBase, we encourage you to contribute upstream! See [contributing](/resources/contributing).
</Info>

## Common Scenarios

<Accordion title="Building a SaaS Application">
  **Scenario**: You're building a SaaS product that uses TrailBase as its backend.

  **Answer**: ✅ Freely allowed!

  * Your application code is not affected
  * No need to open source your app
  * Commercial use is permitted
  * If you modify TrailBase itself, share those modifications
</Accordion>

<Accordion title="Using WASM Components">
  **Scenario**: You write custom WASM components for server-side logic.

  **Answer**: ✅ Your WASM code is not affected!

  * WASM components are not derivative works
  * Keep your components private if desired
  * Commercial use is fine
  * Client libraries use Apache-2.0 (permissive)
</Accordion>

<Accordion title="Modifying TrailBase Core">
  **Scenario**: You need to modify TrailBase's Rust code to add a feature.

  **Answer**: 📝 Must share modifications

  * Your modifications to TrailBase must be OSL-3.0
  * Provide source to users of your modified version
  * Your application using it is still safe
  * Consider contributing upstream!
</Accordion>

<Accordion title="Embedding in a Product">
  **Scenario**: You want to embed TrailBase in your commercial product.

  **Answer**: ✅ Allowed!

  * Include TrailBase as-is in your product
  * Commercial distribution is fine
  * Include OSL-3.0 license text
  * Provide TrailBase source code (or link to GitHub)
  * Your product code remains private
</Accordion>

<Accordion title="Creating a Fork">
  **Scenario**: You want to create a public fork of TrailBase.

  **Answer**: 📝 Fork must be OSL-3.0

  * Your fork must use OSL-3.0
  * Make source available
  * Cannot claim to be "official" TrailBase
  * Consider contributing to upstream instead
</Accordion>

<Accordion title="Using Client Libraries">
  **Scenario**: You're using TrailBase client libraries in your app.

  **Answer**: ✅ Completely free!

  * Client libraries are Apache-2.0
  * Use in any project (open or closed)
  * No copyleft requirements
  * Commercial use is fine
</Accordion>

## Contributor License Agreement

Contributors to TrailBase are asked to sign a simple CLA:

<Accordion title="Why a CLA?">
  The CLA:

  ✅ **You retain copyright**: Contributions remain yours

  ✅ **Forever open source**: Ensures OSI-approved copyleft license

  ✅ **Flexibility**: Allows some sub-licensing (like Grafana/Element)

  ✅ **Legal clarity**: Protects contributors and users

  We're still refining the exact licensing model for compatibility between OSL-3.0 and more popular licenses. The CLA provides flexibility while guaranteeing open source forever.
</Accordion>

<Accordion title="What You're Agreeing To">
  By signing the CLA, you agree:

  1. You have the right to contribute the code
  2. Your contribution can be licensed under OSL-3.0
  3. You retain your copyright
  4. TrailBase can sub-license with restrictions (remains copyleft)
  5. The project will remain open source

  Similar to CLAs used by Grafana, Element, and other successful projects.
</Accordion>

## Source Code Availability

OSL-3.0 requires source code availability:

<Accordion title="Unmodified TrailBase">
  If you distribute unmodified TrailBase:

  * Link to the official GitHub repository
  * Or include the source code
  * Include the LICENSE file
  * Preserve copyright notices
</Accordion>

<Accordion title="Modified TrailBase">
  If you distribute modifications:

  * Provide your modified source code
  * License under OSL-3.0
  * Document your changes
  * Make it reasonably accessible
  * Include the LICENSE file
</Accordion>

## License Exceptions

If the OSL-3.0 license doesn't work for your use case, exceptions may be available.

<Warning>
  License exceptions are evaluated case-by-case. Most users won't need one.
</Warning>

**When you might need an exception:**

* You need to modify TrailBase but cannot share changes
* Your legal team has specific license requirements
* Special commercial arrangements

**To request an exception:**

Contact: **[contact@trailbase.io](mailto:contact@trailbase.io)**

This follows the [selling exceptions](https://www.gnu.org/philosophy/selling-exceptions.html) model established by other open-source projects.

## Additional Resources

<CardGroup cols={2}>
  <Card title="OSL-3.0 Full Text" icon="file-contract" href="https://opensource.org/licenses/OSL-3.0">
    Read the complete license
  </Card>

  <Card title="OSL-3.0 Explained" icon="book-open" href="https://rosenlaw.com/OSL3.0-explained.htm">
    Author's explanation of OSL-3.0
  </Card>

  <Card title="Apache-2.0" icon="file-contract" href="https://opensource.org/license/apache-2-0">
    Client library license
  </Card>

  <Card title="GitHub License" icon="github" href="https://github.com/trailbaseio/trailbase/blob/main/LICENSE">
    LICENSE file in repository
  </Card>
</CardGroup>

## Frequently Asked Questions

<Accordion title="Can I use TrailBase commercially?">
  ✅ Yes! Commercial use is explicitly allowed. Your commercial application using TrailBase is not affected by copyleft.
</Accordion>

<Accordion title="Do I need to open source my application?">
  ❌ No! Your application code is not a derivative work. Only modifications to TrailBase itself are subject to copyleft.
</Accordion>

<Accordion title="Can I sell a product that includes TrailBase?">
  ✅ Yes! You can distribute TrailBase with your product. Just include the license and provide source code (or link to it).
</Accordion>

<Accordion title="What if I make a small change to TrailBase?">
  📝 All modifications must be shared, regardless of size. Consider contributing it upstream!
</Accordion>

<Accordion title="Are WASM components considered modifications?">
  ❌ No! WASM components are not derivative works. Your WASM code is not affected by OSL-3.0.
</Accordion>

<Accordion title="Can I use a different license for my WASM components?">
  ✅ Yes! WASM components are your code and can use any license you choose.
</Accordion>

<Accordion title="What about the client libraries?">
  Client libraries use Apache-2.0 (permissive, no copyleft). Use them in any project without restrictions.
</Accordion>

<Accordion title="Do I need permission to use TrailBase?">
  ❌ No permission needed! The license grants you all necessary rights.
</Accordion>

<Accordion title="Can I remove copyright notices?">
  ❌ No. You must preserve copyright and attribution notices.
</Accordion>

<Accordion title="What if I'm still unsure?">
  Reach out! We're happy to clarify. Email with questions or concerns.
</Accordion>

## Summary

TrailBase's licensing is designed to be **fair and clear**:

* **Use freely**: Build applications without restrictions
* **Share improvements**: Modifications to TrailBase are shared with the community
* **Permissive clients**: Client libraries have no copyleft
* **Commercial friendly**: Use in commercial projects
* **Open forever**: TrailBase will always be open source

<Card title="Questions?" icon="question" href="mailto:contact@trailbase.io">
  Contact us if you have licensing questions or need clarification
</Card>
