GitHub Backup
One-way sync of your Odyn project's source files and built bundles to a GitHub repository you own, on every production deploy.
Connect a GitHub account to Odyn and link any project to a repository you own. On every production deploy, Odyn commits your source files and the built bundle to that repository, regenerates a README, and tags the release. Staging deploys are not synced — only production.
Three reasons people use this:
- Backup. Your code lives in your own GitHub, not just Odyn's database.
- Client handoff. Hand the repository URL to a client at the end of an engagement.
- Alternate hosting. Build in Odyn, serve from jsDelivr or another CDN. The repository is the bridge.
Watch the walkthrough
Connect your GitHub account
- Open Settings → Integrations.
- Click Connect. You'll be sent to GitHub to install the Odyn GitHub App.
- Choose All repositories or Only select repositories. Odyn can only push to repositories you grant.
- Click Install.
GitHub redirects back to Odyn and you'll see a "Connected as @your-handle" status with a brand-blue indicator dot.
No long-lived OAuth tokens are stored. Odyn signs short-lived (1-hour) install tokens on demand against the GitHub App private key.
Claiming an existing install
If the Odyn GitHub App is already installed on your account (because you installed it directly from github.com, or you reset a previous Odyn org link), the Integrations tab will show a one-click Link to this org option. Use that instead of going through the full install flow again.
Link a project to a repository
- Open the project.
- Click the Settings gear icon in the editor sidebar.
- Select the Backup tab.
- Pick a path:
- Pick existing — search and select any repository the App has access to. The list sorts by most recently updated.
- Create new — type a repository name. For organization-level installs, Odyn creates the repository for you. For personal-account installs, Odyn opens github.com prefilled with the name; create it there, return to Odyn, and click Refresh in the picker.
Once linked, the Backup tab shows the linked repository, the linked branch, and (after the first sync) the most recent commit SHA and version number.
What gets synced on a production deploy
| Path in repo | Contents |
|---|---|
src/ | Your current source files, mirroring the editor |
dist/v{n}/ | Built artifacts for that specific deploy — immutable, never overwritten |
dist/latest/ | Built artifacts for the most recent deploy — overwritten on each push |
README.md | Auto-generated, with version, deploy timestamp, and ready-to-paste jsDelivr URLs |
v{n} Git tag | Points at the commit for that version |
Anything else in your repository (a hand-written README, GitHub Actions workflows, branch protection rules, additional folders) survives untouched — Odyn writes its commit on top of the existing tree.
If you delete a source file in the Odyn editor between deploys, the next sync removes it from src/ and dist/latest/. The dist/v{n}/ archives are never modified, so older versions remain reachable.
Public or private — which to choose
This is the key decision once you've linked a repository.
Private repository
A pure backup. Your code is mirrored, nobody else can see it, and you keep serving production traffic from Odyn's CDN as usual.
Public repository
Unlocks jsDelivr, a free global CDN that serves any file in a public GitHub repository. Pin your <script> tag to a v{n} Git tag and you get an immutable, cached-forever URL — no Odyn dependency in the serving path.
Pick public when you want jsDelivr (or any other public-Git-based CDN) or when you don't mind your code being readable. Pick private when the code is sensitive.
Using jsDelivr
After your first production deploy syncs, open the repository on github.com and check the auto-generated README — it lists exact jsDelivr URLs for every artifact in the current version.
The general URL shape:
https://cdn.jsdelivr.net/gh/<owner>/<repo>@v{n}/dist/v{n}/bundle.jsFor example, after a v3 deploy of your-org/your-project:
<script src="https://cdn.jsdelivr.net/gh/your-org/your-project@v3/dist/v3/bundle.js"></script>Always pin to a v{n} tag in production embeds. Tagged URLs are immutable and cached forever. Branch-path URLs like @main/dist/latest/... are cached by jsDelivr for up to 12 hours, so they lag your deploys.
Odyn issues a best-effort cache purge against dist/latest/ paths after each sync to shorten that lag, but version-pinning remains the right pattern for production.
Switching from Odyn's CDN to jsDelivr
Both serving strategies are equally supported. To switch:
- Make sure your repository is public.
- Open the repository's README and copy the pinned jsDelivr URL for the current version.
- Replace the Odyn embed
<script>tag on your site with the jsDelivr URL. - On every subsequent production deploy, update the version number in the URL (
v3→v4) when you want to roll your live site forward.
Disconnect or unlink
Two layers, with different scopes.
Unlink a project (Project Settings → Backup → Unlink). Future production deploys for that project will no longer sync. The GitHub repository is untouched — your existing commit history stays put. You can re-link the same project to the same or a different repository at any time.
Disconnect the account (Settings → Integrations → Disconnect). Future production deploys for all projects in this organization will no longer sync. The Odyn GitHub App stays installed on your GitHub account — to fully remove Odyn's access, also uninstall the App at github.com/settings/installations.
Disconnect is a soft delete. Reconnecting later resumes sync from the next deploy onward.
Webhook lifecycle
If you uninstall or suspend the GitHub App on github.com, Odyn receives a webhook and marks the install as disconnected automatically. You can reconnect from Settings → Integrations whenever you're ready.
Unsuspends on the GitHub side do not auto-reconnect; click Connect again to re-establish the link.
Limitations (Phase 0)
- Production only. Staging deploys are not synced.
- One repository per project. You can swap which repository is linked at any time, but each Odyn project maps to a single repository.
- One-way only. Edits made directly on GitHub will not flow back to Odyn — they'll be overwritten by the next deploy. Two-way sync is on the roadmap.
- Create-new for personal accounts requires github.com. GitHub App tokens can't create personal repositories directly, so personal-account installs use a github.com deep-link instead. Organization-account installs create repositories without leaving Odyn.
Troubleshooting
The repository picker is empty. The App may have been installed with access to no repositories. Visit github.com/settings/installations, find the Odyn install, and grant access to the repositories you want available.
"That installation is no longer claimable." Someone else has already linked the install to a different Odyn org, or the install was uninstalled on the GitHub side. Reinstall from Settings → Integrations.
The repository on GitHub isn't updating. Sync only fires on production deploys. Confirm you deployed to production, not staging. If you did and still see no update, check Settings → Integrations — if your install was uninstalled or suspended, the status will reflect that.
jsDelivr is serving stale content. Branch-path URLs (@main/dist/latest/...) cache for up to 12 hours. Pin to a version tag (@v3/...) for immutable, cached-forever URLs.