Skip to content

docs: Document using models on the client only - #739

Merged
developerjamiu merged 2 commits into
serverpod:mainfrom
abdulawalarif:docs/3670-client-side-only-models
Aug 14, 2026
Merged

docs: Document using models on the client only#739
developerjamiu merged 2 commits into
serverpod:mainfrom
abdulawalarif:docs/3670-client-side-only-models

Conversation

@abdulawalarif

Copy link
Copy Markdown
Contributor

Summary

Working with models covered serverOnly and field scope, but not that you can define models you only use in Flutter. There is no clientOnly flag. Place the YAML in the server package as usual; generating the class on the server as well is harmless.

Fixes serverpod/serverpod#3670

Changes

  • Add a "Using models on the client only" section after the visibility examples.
  • Show placing the .spy.yaml file in the server package, running code generation, and importing the class from the client package.
  • Note that omitting table avoids creating a database table, and point to immutable: true and shared packages.

Reference

Comment thread docs/06-concepts/03-data-and-the-database/01-models/01-working-with-models.md Outdated
Comment thread docs/06-concepts/03-data-and-the-database/01-models/01-working-with-models.md Outdated
Comment thread docs/06-concepts/03-data-and-the-database/01-models/01-working-with-models.md Outdated
Comment thread docs/06-concepts/03-data-and-the-database/01-models/01-working-with-models.md Outdated
@abdulawalarif

Copy link
Copy Markdown
Contributor Author

Thanks for the review.
Applied all four suggestions.

@developerjamiu developerjamiu added the documentation Improvements or additions to documentation label Aug 14, 2026
@developerjamiu

Copy link
Copy Markdown
Contributor

Thanks for the contribution

@developerjamiu
developerjamiu merged commit 0780c1e into serverpod:main Aug 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mention creating models that are used client-side only

2 participants