diff --git a/apps/oauth2/js/oauth2.js b/apps/oauth2/js/oauth2.js
index 69c71d86c0df035297972d4f4672c6364651a8ea..b7f6ca809e4dbffaa28b3c042f18e1b2ec587336 100644
Binary files a/apps/oauth2/js/oauth2.js and b/apps/oauth2/js/oauth2.js differ
diff --git a/apps/oauth2/js/oauth2.js.map b/apps/oauth2/js/oauth2.js.map
index 1d0e7dcb8d4d8ef6eb8e626611ece4d33b53a07f..6485fa3d9de8dcb903d5235f3831fafa520c3ee8 100644
Binary files a/apps/oauth2/js/oauth2.js.map and b/apps/oauth2/js/oauth2.js.map differ
diff --git a/apps/oauth2/src/main.js b/apps/oauth2/src/main.js
index 45b9d6427672f2af95711ea455d656c30bdb3dcd..61aea381151e5b2392b76b2082ea9ca38bd99f85 100644
--- a/apps/oauth2/src/main.js
+++ b/apps/oauth2/src/main.js
@@ -22,7 +22,7 @@
 
 import Vue from 'vue'
 import App from './App.vue'
-import { loadState } from 'nextcloud-initial-state'
+import { loadState } from '@nextcloud/initial-state'
 
 Vue.prototype.t = t
 Vue.prototype.OC = OC
diff --git a/apps/settings/js/vue-0.js b/apps/settings/js/vue-0.js
index 1cdfeeacf05ea0a5e9e2dbcb9c5efaddfd0dfb39..e576aef09eeaaa803c8e7e05633cdb1f3c58dd93 100644
Binary files a/apps/settings/js/vue-0.js and b/apps/settings/js/vue-0.js differ
diff --git a/apps/settings/js/vue-0.js.map b/apps/settings/js/vue-0.js.map
index 9726a4556757e52a42c2db6dde509a4e54b63c19..6acbdf4ff43852f71348363da51dbdfdfddf4e61 100644
Binary files a/apps/settings/js/vue-0.js.map and b/apps/settings/js/vue-0.js.map differ
diff --git a/apps/settings/js/vue-4.js b/apps/settings/js/vue-4.js
index 86d5e006d075018d752d07038fa107cdea8b1208..a84f88bcbb7683efe11aaa50691b99389c3c3ec4 100644
Binary files a/apps/settings/js/vue-4.js and b/apps/settings/js/vue-4.js differ
diff --git a/apps/settings/js/vue-4.js.map b/apps/settings/js/vue-4.js.map
index bfcea3af70503ec6643930f4eec79ceebf6f54bf..17f0b0115c1fa93a33e400c0b6db47ed41e75628 100644
Binary files a/apps/settings/js/vue-4.js.map and b/apps/settings/js/vue-4.js.map differ
diff --git a/apps/settings/js/vue-5.js b/apps/settings/js/vue-5.js
index ff5d349328b781b75a8fbfd3428fbd2bd76497a6..5d0a69e13c1e23194819636aac098851c91d6a15 100644
Binary files a/apps/settings/js/vue-5.js and b/apps/settings/js/vue-5.js differ
diff --git a/apps/settings/js/vue-5.js.map b/apps/settings/js/vue-5.js.map
index f65ae2215ba906a69e08f4dca9e58d489050f967..7c3b7c6fc8a2ae329fd7c79ddca9b89286394b0a 100644
Binary files a/apps/settings/js/vue-5.js.map and b/apps/settings/js/vue-5.js.map differ
diff --git a/apps/settings/js/vue-6.js b/apps/settings/js/vue-6.js
index 780dbfa5d0042e5a1cfa02919c73975775a0aca3..2bd9d476d98acaa7946ece87598659d4c937c777 100644
Binary files a/apps/settings/js/vue-6.js and b/apps/settings/js/vue-6.js differ
diff --git a/apps/settings/js/vue-6.js.map b/apps/settings/js/vue-6.js.map
index 4197934f7ae0607c99cc981710c64765fa0db367..29c73a85e3f9cf2cd7cdfde7369b908b4fc87612 100644
Binary files a/apps/settings/js/vue-6.js.map and b/apps/settings/js/vue-6.js.map differ
diff --git a/apps/settings/js/vue-settings-admin-security.js b/apps/settings/js/vue-settings-admin-security.js
index 78b4c0e7e675deeca8b25a4dcbad5ec5ce754bd4..3a5bc18a4955d71666f72dbfd2b5640bdc86b453 100644
Binary files a/apps/settings/js/vue-settings-admin-security.js and b/apps/settings/js/vue-settings-admin-security.js differ
diff --git a/apps/settings/js/vue-settings-admin-security.js.map b/apps/settings/js/vue-settings-admin-security.js.map
index 3485cf808cdd03da59d368fd96ec9ecfa82db905..b787ae4eeb896fc0c2763b057ee41dd223bb0199 100644
Binary files a/apps/settings/js/vue-settings-admin-security.js.map and b/apps/settings/js/vue-settings-admin-security.js.map differ
diff --git a/apps/settings/js/vue-settings-apps-users-management.js b/apps/settings/js/vue-settings-apps-users-management.js
index 846f9755cfbf23fd15bcba384c7004b89ed954e2..55b2e8a34202ce48bdce8487164164859c7109fb 100644
Binary files a/apps/settings/js/vue-settings-apps-users-management.js and b/apps/settings/js/vue-settings-apps-users-management.js differ
diff --git a/apps/settings/js/vue-settings-apps-users-management.js.map b/apps/settings/js/vue-settings-apps-users-management.js.map
index 6eecca8cfd8b3c8a002256b15313944540d9f548..722d750c6246c67638dd80e25c4fdecd90a831ee 100644
Binary files a/apps/settings/js/vue-settings-apps-users-management.js.map and b/apps/settings/js/vue-settings-apps-users-management.js.map differ
diff --git a/apps/settings/js/vue-settings-personal-security.js b/apps/settings/js/vue-settings-personal-security.js
index 9f3a9a79fe701592df04b30cc89acf19d91aca7a..de61795b41b308ce8d2a61ebe95c4e6947ba2b03 100644
Binary files a/apps/settings/js/vue-settings-personal-security.js and b/apps/settings/js/vue-settings-personal-security.js differ
diff --git a/apps/settings/js/vue-settings-personal-security.js.map b/apps/settings/js/vue-settings-personal-security.js.map
index 93864953eb9af0859ee5edc4f6f92365f46eff26..045f45f3613e4c806ee6a0ea63e1d2f08b3d3a06 100644
Binary files a/apps/settings/js/vue-settings-personal-security.js.map and b/apps/settings/js/vue-settings-personal-security.js.map differ
diff --git a/apps/settings/src/main-admin-security.js b/apps/settings/src/main-admin-security.js
index d775f6ac1333834cab7be481a7a447286b1303da..345d1b3407b782e6ac6b188c3c92f7e12a64c8ae 100644
--- a/apps/settings/src/main-admin-security.js
+++ b/apps/settings/src/main-admin-security.js
@@ -1,3 +1,4 @@
+import { loadState } from '@nextcloud/initial-state'
 import Vue from 'vue'
 
 import AdminTwoFactor from './components/AdminTwoFactor.vue'
@@ -13,7 +14,7 @@ window.OC = window.OC || {}
 window.OC.Settings = window.OC.Settings || {}
 
 store.replaceState(
-	OCP.InitialState.loadState('settings', 'mandatory2FAState')
+	loadState('settings', 'mandatory2FAState')
 )
 
 const View = Vue.extend(AdminTwoFactor)
diff --git a/apps/settings/src/main-personal-security.js b/apps/settings/src/main-personal-security.js
index dd20d5d1031bf9c1e6bb5efae58559bc1597ea5d..85a88bf8f1de7ed20ee320a896cb86e16737fd10 100644
--- a/apps/settings/src/main-personal-security.js
+++ b/apps/settings/src/main-personal-security.js
@@ -19,6 +19,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+import { loadState } from '@nextcloud/initial-state'
 import Vue from 'vue'
 import VueClipboard from 'vue-clipboard2'
 import VTooltip from 'v-tooltip'
@@ -35,7 +36,7 @@ Vue.prototype.t = t
 const View = Vue.extend(AuthTokenSection)
 new View({
 	propsData: {
-		tokens: OCP.InitialState.loadState('settings', 'app_tokens'),
-		canCreateToken: OCP.InitialState.loadState('settings', 'can_create_app_token')
+		tokens: loadState('settings', 'app_tokens'),
+		canCreateToken: loadState('settings', 'can_create_app_token')
 	}
 }).$mount('#security-authtokens')
diff --git a/apps/twofactor_backupcodes/js/settings.js b/apps/twofactor_backupcodes/js/settings.js
index 4db503e67bed301bc48561e0e63613bf20277084..2c246c033930a4e80c4074b63c837b21cf7a3c5e 100644
Binary files a/apps/twofactor_backupcodes/js/settings.js and b/apps/twofactor_backupcodes/js/settings.js differ
diff --git a/apps/twofactor_backupcodes/js/settings.js.map b/apps/twofactor_backupcodes/js/settings.js.map
index 0dd113ad1bdc7b1cb433b8aad7281e22fa8ce193..85f9702e0f7d3ef25b83c3d3b1ca4b794aae4493 100644
Binary files a/apps/twofactor_backupcodes/js/settings.js.map and b/apps/twofactor_backupcodes/js/settings.js.map differ
diff --git a/apps/twofactor_backupcodes/src/settings.js b/apps/twofactor_backupcodes/src/settings.js
index 89a56ee2e5a810508e5737aacda45be68486c85c..32eb37fa91a37ee00e17a22d0282907f564e0e0a 100644
--- a/apps/twofactor_backupcodes/src/settings.js
+++ b/apps/twofactor_backupcodes/src/settings.js
@@ -1,13 +1,13 @@
+import { loadState } from '@nextcloud/initial-state'
 import Vue from 'vue'
+
 import PersonalSettings from './views/PersonalSettings'
 import store from './store'
 
 Vue.prototype.t = t
 
-const initialState = OCP.InitialState.loadState('twofactor_backupcodes', 'state')
-store.replaceState(
-	initialState
-)
+const initialState = loadState('twofactor_backupcodes', 'state')
+store.replaceState(initialState)
 
 const View = Vue.extend(PersonalSettings)
 new View({
diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js
index d3487776f43ced1d19241346068380284d961bed..e3be38a7224d2dacf01651811440add8ea087685 100644
Binary files a/apps/workflowengine/js/workflowengine.js and b/apps/workflowengine/js/workflowengine.js differ
diff --git a/apps/workflowengine/js/workflowengine.js.map b/apps/workflowengine/js/workflowengine.js.map
index f5d3a503a627546649e8a77e97a9082d2c660aa1..0708d9dfa70345d5d13b9c5475df677eec2a4c47 100644
Binary files a/apps/workflowengine/js/workflowengine.js.map and b/apps/workflowengine/js/workflowengine.js.map differ
diff --git a/apps/workflowengine/src/helpers/api.js b/apps/workflowengine/src/helpers/api.js
index a6dc3a3d03a97da3d73bb812ed142cd25f4acd6f..2b2bb40a7e28a2b74c6e42ecee1d7a731717ad10 100644
--- a/apps/workflowengine/src/helpers/api.js
+++ b/apps/workflowengine/src/helpers/api.js
@@ -20,8 +20,10 @@
  *
  */
 
+import { loadState } from '@nextcloud/initial-state'
+
 const getApiUrl = (url) => {
-	const scopeValue = OCP.InitialState.loadState('workflowengine', 'scope') === 0 ? 'global' : 'user'
+	const scopeValue = loadState('workflowengine', 'scope') === 0 ? 'global' : 'user'
 	return OC.linkToOCS('apps/workflowengine/api/v1/workflows', 2) + scopeValue + url + '?format=json'
 }
 
diff --git a/apps/workflowengine/src/store.js b/apps/workflowengine/src/store.js
index 41e170c054147917bf148fe1f8d945f3c911f1e6..cbd9b29c81c1a63fa53afd7c1074b2998c6979f1 100644
--- a/apps/workflowengine/src/store.js
+++ b/apps/workflowengine/src/store.js
@@ -25,22 +25,23 @@ import Vuex from 'vuex'
 import axios from '@nextcloud/axios'
 import { getApiUrl } from './helpers/api'
 import confirmPassword from 'nextcloud-password-confirmation'
+import { loadState } from '@nextcloud/initial-state'
 
 Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
 		rules: [],
-		scope: OCP.InitialState.loadState('workflowengine', 'scope'),
-		operations: OCP.InitialState.loadState('workflowengine', 'operators'),
+		scope: loadState('workflowengine', 'scope'),
+		operations: loadState('workflowengine', 'operators'),
 
 		plugins: Vue.observable({
 			checks: {},
 			operators: {}
 		}),
 
-		entities: OCP.InitialState.loadState('workflowengine', 'entities'),
-		events: OCP.InitialState.loadState('workflowengine', 'entities')
+		entities: loadState('workflowengine', 'entities'),
+		events: loadState('workflowengine', 'entities')
 			.map((entity) => entity.events.map(event => {
 				return {
 					id: `${entity.id}::${event.eventName}`,
@@ -48,7 +49,7 @@ const store = new Vuex.Store({
 					...event
 				}
 			})).flat(),
-		checks: OCP.InitialState.loadState('workflowengine', 'checks')
+		checks: loadState('workflowengine', 'checks')
 	},
 	mutations: {
 		addRule(state, rule) {
diff --git a/core/js/dist/login.js b/core/js/dist/login.js
index 4ec28e0d94a7e25d03a76be54728a5a1ab7a5f23..efc1ba93c0d43561f49dcf6f214137cf740bb511 100644
Binary files a/core/js/dist/login.js and b/core/js/dist/login.js differ
diff --git a/core/js/dist/login.js.map b/core/js/dist/login.js.map
index 213306219db01b6dc809c5b8241991868e53d758..67b25b23f32277994d3fdeefd567541c024ea7c0 100644
Binary files a/core/js/dist/login.js.map and b/core/js/dist/login.js.map differ
diff --git a/core/js/dist/main.js b/core/js/dist/main.js
index 44124f3994e0da29ffe9fbf1f8a177c24d6261e8..d91e74256c3bb9f2fa541d3caef78da2358f3096 100644
Binary files a/core/js/dist/main.js and b/core/js/dist/main.js differ
diff --git a/core/js/dist/main.js.map b/core/js/dist/main.js.map
index 40e5ea7df68ffa560e44a92c9f5099267e5b8cdd..1838ba255eedfd7f788b7edff5281c3cbeb6f7b6 100644
Binary files a/core/js/dist/main.js.map and b/core/js/dist/main.js.map differ
diff --git a/core/js/dist/maintenance.js b/core/js/dist/maintenance.js
index 4bb1d8c1013fd03d9d1a1fb477d3b892fa618c93..59b1f981dfb617f09bcc478adc29e6753a415c13 100644
Binary files a/core/js/dist/maintenance.js and b/core/js/dist/maintenance.js differ
diff --git a/core/js/dist/maintenance.js.map b/core/js/dist/maintenance.js.map
index 3e7b4b087cdf6efc09295d2b3c4728b5afa71998..1e0f8015be09476297c3a80baf036af5dfcfcbd4 100644
Binary files a/core/js/dist/maintenance.js.map and b/core/js/dist/maintenance.js.map differ
diff --git a/core/src/OCP/index.js b/core/src/OCP/index.js
index 7d5edd5a9d00ebc2fef04adc462f8a21fef188b8..3309e3fe047a6bbe21b41db5f105045009b92d0e 100644
--- a/core/src/OCP/index.js
+++ b/core/src/OCP/index.js
@@ -3,8 +3,8 @@
  */
 import * as AppConfig from './appconfig'
 import * as Comments from './comments'
-import * as InitialState from './initialstate'
 import Loader from './loader'
+import { loadState } from '@nextcloud/initial-state'
 import Collaboration from './collaboration'
 import Toast from './toast'
 import * as WhatsNew from './whatsnew'
@@ -14,7 +14,12 @@ export default {
 	AppConfig,
 	Collaboration,
 	Comments,
-	InitialState,
+	InitialState: {
+		/**
+		 * @deprecated 18.0.0 add https://www.npmjs.com/package/@nextcloud/initial-state to your app
+		 */
+		loadState
+	},
 	Loader,
 	Toast,
 	WhatsNew
diff --git a/core/src/OCP/initialstate.js b/core/src/OCP/initialstate.js
index 0a6f364ed000e0f8ed44fa64199ef039989cd3df..57a1162bedbe7743954d48ac0b6db6d8fe407de3 100644
--- a/core/src/OCP/initialstate.js
+++ b/core/src/OCP/initialstate.js
@@ -24,19 +24,6 @@
  * @namespace OCP.InitialState
  */
 
-export function loadState(app, key) {
-	const elem = document.querySelector(`#initial-state-${app}-${key}`)
-	if (elem === null) {
-		const msg = `Could not find initial state ${key} of ${app}`
-		console.debug(msg)
-		throw new Error(msg)
-	}
+import { loadState as load } from '@nextcloud/initial-state'
 
-	try {
-		return JSON.parse(atob(elem.value))
-	} catch (e) {
-		const msg = `Could not parse initial state ${key} of ${app}`
-		console.debug(msg)
-		throw new Error(msg)
-	}
-}
+export const loadState = load
diff --git a/core/src/login.js b/core/src/login.js
index 4314da7ab07000f00a3387d8c2e2e46a5337725e..bb6426af1d41e746b64ccb94fee7c210b971cada 100644
--- a/core/src/login.js
+++ b/core/src/login.js
@@ -19,8 +19,9 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-import Vue from 'vue'
+import { loadState } from '@nextcloud/initial-state'
 import queryString from 'query-string'
+import Vue from 'vue'
 
 // eslint-disable-next-line no-unused-vars
 import OC from './OC/index' // TODO: Not needed but L10n breaks if removed
@@ -42,7 +43,7 @@ Vue.mixin(Nextcloud)
 
 const fromStateOr = (key, orValue) => {
 	try {
-		return OCP.InitialState.loadState('core', key)
+		return loadState('core', key)
 	} catch (e) {
 		return orValue
 	}
diff --git a/package-lock.json b/package-lock.json
index a2935dbda2534811c0a1d925ea249249b028a260..3011a4891fa1cd0559961b7675d745e2797e03f9 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -866,6 +866,21 @@
         }
       }
     },
+    "@nextcloud/initial-state": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-0.2.0.tgz",
+      "integrity": "sha512-aFkEXxEchawyn1HWn/nStX25324/4+RcOHiHJ1gW/vVH6bPRW8suj9V1Rsi380mMRM7sjkICyeNPxOZ8f+WZrA==",
+      "requires": {
+        "core-js": "3.1.4"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "3.1.4",
+          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.1.4.tgz",
+          "integrity": "sha512-YNZN8lt82XIMLnLirj9MhKDFZHalwzzrL9YLt6eb0T5D0EDl4IQ90IGkua8mHbnxNrkj1d8hbdizMc0Qmg1WnQ=="
+        }
+      }
+    },
     "@nextcloud/paths": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-0.2.0.tgz",
@@ -6200,21 +6215,6 @@
         "axios": "^0.19.0"
       }
     },
-    "nextcloud-initial-state": {
-      "version": "0.0.3",
-      "resolved": "https://registry.npmjs.org/nextcloud-initial-state/-/nextcloud-initial-state-0.0.3.tgz",
-      "integrity": "sha512-sL0dKbOb63QwvkAfQdDC5AldshVwaY8B8tKpAci7UMmJV3M1KLxTBzQoY+CVy03/uqTvvFt3Brz/Bd2UNp3zsQ==",
-      "requires": {
-        "core-js": "^3.1.4"
-      },
-      "dependencies": {
-        "core-js": {
-          "version": "3.2.1",
-          "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.2.1.tgz",
-          "integrity": "sha512-Qa5XSVefSVPRxy2XfUC13WbvqkxhkwB3ve+pgCQveNgYzbM/UxZeu1dcOX/xr4UmfUd+muuvsaxilQzCyUurMw=="
-        }
-      }
-    },
     "nextcloud-password-confirmation": {
       "version": "0.4.2",
       "resolved": "https://registry.npmjs.org/nextcloud-password-confirmation/-/nextcloud-password-confirmation-0.4.2.tgz",
diff --git a/package.json b/package.json
index a5f5eb12634b0f06ee239a2f34769047d3cc4f68..b62adaa014654b8da2b5d63c9a314ea3e74e23be 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
     "@chenfengyuan/vue-qrcode": "^1.0.1",
     "@nextcloud/axios": "^0.4.1",
     "@nextcloud/event-bus": "^0.2.1",
+    "@nextcloud/initial-state": "^0.2.0",
     "@nextcloud/paths": "^0.2.0",
     "@nextcloud/router": "^0.1.0",
     "autosize": "^4.0.2",
@@ -48,7 +49,6 @@
     "marked": "^0.7.0",
     "moment": "^2.24.0",
     "moment-timezone": "^0.5.26",
-    "nextcloud-initial-state": "0.0.3",
     "nextcloud-password-confirmation": "^0.4.2",
     "nextcloud-router": "0.0.9",
     "nextcloud-vue": "^0.12.3",