{"id":408761,"date":"2023-11-02T14:27:16","date_gmt":"2023-11-02T14:27:16","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=408761"},"modified":"2026-03-10T13:51:12","modified_gmt":"2026-03-10T13:51:12","slug":"how-to-use-indexeddb-dexie-in-nextjs","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/","title":{"rendered":"How to use indexedDB (Dexie) in NextJs"},"content":{"rendered":"\n<p>IndexedDB is a low-level API in web browsers that provides to store, retrieve, and perform transactions on large amounts of NoSQL data in the client&#8217;s browser.<\/p>\n\n\n\n<p>It&#8217;s designed for <a href=\"https:\/\/webkul.com\/website-development\/\">web application development<\/a> that needs to work offline or require large amounts of data to be stored locally.<\/p>\n\n\n\n<p>Also, look no further and grab the opportunity to start your&nbsp;<a href=\"https:\/\/webkul.com\/magento-2-react-development-services\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 React development<\/a>&nbsp;with the certified&nbsp;<a href=\"https:\/\/webkul.com\/magento-development\/\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 development company<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is dexie?<\/strong><\/h2>\n\n\n\n<p>Dexie is a JavaScript library that provides a higher-level API for working with IndexedDB.<\/p>\n\n\n\n<p>It simplifies the process of interacting with IndexedDB by providing a more intuitive and developer-friendly interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Here are some key features of Dexie:<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Promise-Based API:<\/strong><\/h3>\n\n\n\n<p>Dexie uses Promises, which makes it easier to work with asynchronous operations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Simplified Syntax:<\/strong><\/h3>\n\n\n\n<p><strong> <\/strong>It provides a clean and easy-to-use syntax for common operations like creating, reading, updating, and deleting data.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Querying and Filtering:<\/strong><\/h3>\n\n\n\n<p><strong> <\/strong>Dexie includes various methods with the help of these we can filter, and retrieve specific records.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Dexie Version Control:<\/strong> <\/h3>\n\n\n\n<p> This automatically updates the database and contributes to the schema version maintenance if we make any changes to our table.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Transactions:<\/strong><\/h3>\n\n\n\n<p>Dexie abstracts transactions, making it easier to work with the IndexedDB transaction model.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Support for Complex Data Types:<\/strong><\/h3>\n\n\n\n<p><strong> <\/strong>Dexie can store more complex data types like arrays and objects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Cross-Browser Compatibility:<\/strong><\/h3>\n\n\n\n<p><strong> <\/strong>It provides a consistent API across different browsers, handling any browser-specific quirks or inconsistencies.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Offline Support: <\/strong><\/h3>\n\n\n\n<p>Dexie provides offline support which is useful for building progressive web apps ( PWA ) and with the help of <code>Dexie<\/code> we can store data locally and synchronize it with a server later.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Let&#8217;s see the implementation &nbsp;&#8211;<\/strong><\/h2>\n\n\n\n<p><strong>Step 1: Create a Next.js&nbsp;Project<\/strong><br>The Next.js project must be finished and configured in the first stage for us to use the dexie library to conduct create, update, and delete operations.<\/p>\n\n\n\n<p>To set up, we can follow this <a href=\"https:\/\/webkul.com\/blog\/project-setup-next-js\/\">setup next js project<\/a> blog that covers all about the setup.<\/p>\n\n\n\n<p>Now our next app name is<code> \"<strong>next-dexie-implementation<\/strong>\"<\/code>. The command below must be used to navigate the project directory after it has been established.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">cd next-dexie-implementation<\/pre>\n\n\n\n<p><strong>Step 2: Install Dependencies<\/strong><br>We would install the necessary dependencies for working with dexie in our Next.js project. Execute the subsequent command within your terminal.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">npm install dexie  \/\/ dexie\nnpm install dexie-react-hooks \/\/ dexie hook<\/pre>\n\n\n\n<p><strong>Our project &#8211; structure look like as mentioned below <\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">NEXT-DEXIE-IMPLEMENTATION\/\n\u2502\n\u251c\u2500\u2500 .next\/\n\u2502\n\u251c\u2500\u2500 components\/\n\u2502   \u2514\u2500\u2500 StudentMngmt.tsx\n\u2502\n\u251c\u2500\u2500 db\/\n\u2502   \u2514\u2500\u2500 db.model.ts\n\u2502\n\u251c\u2500\u2500 node_modules\/\n\u2502\n\u251c\u2500\u2500 pages\/\n\u2502   \u251c\u2500\u2500 api\/\n\u2502   \u2502   \u2514\u2500\u2500 hello.ts\n\u2502   \u2502\n\u2502   \u251c\u2500\u2500 _app.tsx\n\u2502   \u251c\u2500\u2500 _document.tsx\n\u2502   \u2514\u2500\u2500 index.tsx\n\u2502\n\u251c\u2500\u2500 public\/\n\u2502   \u251c\u2500\u2500 favicon.ico\n\u2502   \u251c\u2500\u2500 next.svg\n\u2502   \u2514\u2500\u2500 vercel.svg\n\u2502\n\u251c\u2500\u2500 styles\/\n\u2502   \u251c\u2500\u2500 globals.css\n\u2502   \u2514\u2500\u2500 Home.module.css\n\u2502\n\u251c\u2500\u2500 .eslintrc.json\n\u251c\u2500\u2500 .gitignore\n\u251c\u2500\u2500 next-env.d.ts\n\u251c\u2500\u2500 next.config.js\n\u251c\u2500\u2500 package-lock.json\n\u251c\u2500\u2500 package.json\n\u251c\u2500\u2500 README.md\n\u2514\u2500\u2500 tsconfig.json<\/pre>\n\n\n\n<p><strong>Step 3: DB&nbsp;model&nbsp;<\/strong><br>Next, we&#8217;ll build the db.model.ts file and create a db subdirectory in the root directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">import Dexie, { Table } from &#039;dexie&#039;;\n\n\/\/ table inteface\nexport interface Student {\n  id?: number;\n  name: string;\n  rollNumber: number;\n}\n\nexport class DB extends Dexie {\n\/\/ table name is student \n  students!: Table&lt;Student&gt;; \n  constructor() {\n    super(&#039;myDatabase&#039;);\n    this.version(1).stores({\n      students: &#039;++id, name, rollNumber&#039;  \n    });\n  }\n}\n\nexport const db = new DB(); \/\/ export the db<\/pre>\n\n\n\n<p>students is our table name which <strong><code>name<\/code><\/strong> and <strong><code>rollNumber<\/code><\/strong> the key and  primary key with <strong><code>id<\/code><\/strong> name <\/p>\n\n\n\n<p>After initializing the <strong><code>students<\/code><\/strong><em> <\/em>table<em> <\/em>we&#8217;ve exported it as <strong><code>DB<\/code><\/strong> below so that whenever we need to access this <strong><code>DB<\/code><\/strong> we can access it. <\/p>\n\n\n\n<p><strong>Step 4: Create<\/strong>, <strong>update, and delete operations with students&nbsp;table&nbsp;<\/strong><br>As we earlier discussed make create, update, and delete operations with student table data and <\/p>\n\n\n\n<p>there are three fields as you have seen in <strong><code>students<\/code><\/strong> that was <code><strong>name<\/strong><\/code>, <code><strong>rollNumber<\/strong><\/code>, and last is the primary key<strong> <code>id<\/code>.<\/strong><\/p>\n\n\n\n<p>To perform create, update, and delete operations we&#8217;ve created a components directory in the root folder under it we&#8217;ve created <strong><code>StudentMngmt.tsx<\/code> <\/strong>and this file contains these code snippets.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">import React, { FC } from &quot;react&quot;;\nimport { db } from &quot;@\/db\/db.model&quot;;\nimport { useLiveQuery } from &quot;dexie-react-hooks&quot;;\nconst StudentMngmt: FC = () =&gt; {\n  const &#091;students, setStudents] = React.useState({ name: &#039;&#039;, rollNumber: &#039;&#039;, id: null });\n  \/\/ dexie hook to get live data \n  const studentList = useLiveQuery(() =&gt; db.students.toArray());\n\n  \/\/ add student \n  const addStudent = React.useCallback(async () =&gt; {\n    if (students?.name &amp;&amp; students?.rollNumber) {\n      await db.students.add({\n        name: students?.name,\n        rollNumber: Number(students?.rollNumber)\n      });\n      setStudents({ name: &#039;&#039;, rollNumber: &#039;&#039;, id: null });\n    }\n  }, &#091;students])\n\n  \/\/ update student \n  const updateStudent = React.useCallback(async () =&gt; {\n    if (students?.id &amp;&amp; students?.name &amp;&amp; students?.rollNumber) {\n      await db.students.put({\n        id: students?.id,\n        name: students?.name,\n        rollNumber: Number(students?.rollNumber)\n      });\n      setStudents({ name: &#039;&#039;, rollNumber: &#039;&#039;, id: null });\n    }\n  }, &#091;students])\n\n  \/\/ delete student \n  const deleteStudent = React.useCallback(async (id: any) =&gt; {\n    await db.students.delete(id);\n  }, &#091;])\n\n  \/\/ Student list Component\n  const StudentList = () =&gt; {\n    return (\n      &lt;div className=&quot;&quot;&gt;\n        &lt;table &gt;\n          &lt;tr&gt;\n\n            &lt;th&gt;ID&lt;\/th&gt;\n            &lt;th&gt;NAME&lt;\/th&gt;\n            &lt;th&gt;ROLL NUMBER &lt;\/th&gt;\n            &lt;th&gt;DELETE   &lt;\/th&gt;\n            &lt;th&gt;UPDATE  &lt;\/th&gt;\n          &lt;\/tr&gt;\n          {\n            studentList?.map((i: any, index: number) =&gt; {\n              return (\n                &lt;tr key={index}&gt;\n                  &lt;td style={{ paddingTop: &#039;10px&#039; }} &gt;&lt;span style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039; }}&gt;{i.id}&lt;\/span&gt;&lt;\/td&gt;\n                  &lt;td style={{ paddingTop: &#039;10px&#039; }} &gt;&lt;span style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039; }}&gt;{i.name}&lt;\/span&gt;&lt;\/td&gt;\n                  &lt;td style={{ paddingTop: &#039;10px&#039; }} &gt; &lt;span style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039; }}&gt;{i.rollNumber}&lt;\/span&gt;&lt;\/td&gt;\n                  &lt;td style={{ paddingTop: &#039;10px&#039; }} &gt; &lt;button onClick={addStudent} style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039;, marginLeft: &#039;10px&#039; }} onClickCapture={() =&gt; deleteStudent(i.id)}&gt;DELETE&lt;\/button&gt;&lt;\/td&gt;\n                  &lt;td style={{ paddingTop: &#039;10px&#039; }} &gt;&lt;button onClick={() =&gt; setStudents({ ...i })} style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039;, marginLeft: &#039;10px&#039; }}&gt;UPDATE&lt;\/button&gt;&lt;\/td&gt;\n                &lt;\/tr&gt;\n              )\n            })\n          }\n        &lt;\/table&gt;\n      &lt;\/div&gt;)\n  }\n\n  \/\/ Add and Update Form Component \n  return (\n    &lt;div&gt;\n      &lt;div style={{ paddingLeft: &#039;30px&#039; }} &gt;\n        &lt;h2 style={{ marginBottom: &#039;20px&#039;, marginTop: &#039;20px&#039; }}&gt;{students?.id ? &#039;Update&#039; : &#039;Add&#039;} Student &lt;\/h2&gt;\n        &lt;div &gt;\n          &lt;label htmlFor=&quot;Name&quot; style={{ paddingRight: &#039;10px&#039; }}&gt;Name&lt;\/label&gt;\n          &lt;input type=&quot;text&quot; value={students?.name} onChange={(e) =&gt; setStudents({ ...students, name: e.target.value })} placeholder=&quot;Name&quot; name=&quot;Name&quot; style={{ marginRight: &#039;30px&#039; }} \/&gt;\n          &lt;label htmlFor=&quot;roll&quot; style={{ paddingRight: &#039;10px&#039; }}&gt;Roll Number &lt;\/label&gt;\n          &lt;input type=&quot;number&quot; value={students?.rollNumber} onChange={(e) =&gt; setStudents({ ...students, rollNumber: e.target.value })} placeholder=&quot;Roll Number&quot; name=&quot;rollNumber&quot; \/&gt;\n          {\n            students?.id ? (\n              &lt;button onClick={updateStudent} style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039;, marginLeft: &#039;10px&#039; }}&gt;SUBMIT&lt;\/button&gt;\n            ) : (\n              &lt;button onClick={addStudent} style={{ paddingLeft: &#039;10px&#039;, paddingRight: &#039;10px&#039;, marginLeft: &#039;10px&#039; }}&gt;ADD&lt;\/button&gt;\n            )\n          }\n        &lt;\/div&gt;\n        &lt;h2 style={{ marginBottom: &#039;20px&#039;, marginTop: &#039;20px&#039; }}&gt;Student List&lt;\/h2&gt;\n        &lt;div&gt;&lt;StudentList \/&gt;&lt;\/div&gt;\n      &lt;\/div&gt;\n    &lt;\/div&gt;\n  );\n}\nexport default StudentMngmt<\/pre>\n\n\n\n<p>Now let&#8217;s demystify <strong><code>StudentMngmt.tsx<\/code> <\/strong>code snippet,  here <strong><code>db<\/code><\/strong>  is our  indexdDB database exported from<strong> <code>db.model.ts<\/code>  <\/strong>in which we&#8217;ve created <strong><code>students<\/code><\/strong> table  after that we have also <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">import { db } from &quot;@\/db\/db.model&quot;;\nimport { useLiveQuery } from &quot;dexie-react-hooks&quot;;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><code>useLiveQuery<\/code><\/strong><\/h3>\n\n\n\n<p>Imported <strong><code>useLiveQuery<\/code><\/strong> that is a hook that provides live Query data from the table means <\/p>\n\n\n\n<p>if you have added or updated the new data in <strong><code>students<\/code><\/strong> table or any table you don&#8217;t need to call the function or method again and again to get updated data.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">  const studentList = useLiveQuery(() =&gt; db.students.toArray());<\/pre>\n\n\n\n<p>Here <strong><code>studentList<\/code><\/strong> is student table data in array format which we&#8217;ve mapped in our <strong><code>StudentList<\/code><\/strong> component.<\/p>\n\n\n\n<p>And in <strong><code>addStudent<\/code><\/strong> the function we&#8217;re using  <strong><code>db.student.add({name:name , rollNumber:rollNumber})<\/code><\/strong><\/p>\n\n\n\n<p>likewise in <strong><code>updateStudent<\/code><\/strong> function, we&#8217;re using <code><strong>db.student.put({ id:id , name:name , rollNumber:rollNumber})<\/strong> <\/code><\/p>\n\n\n\n<p>need to notice that this update <code>Dexie <\/code>API takes an extra key that is id, basically on the basis of it&#8217;ll find out the particular table data and update those data.<\/p>\n\n\n\n<p>Now our last function related to <code>Dexie<\/code> operation is <strong><code>deleteStudent<\/code><\/strong>   this <code>Dexie<\/code> API <strong><code>db.student.delete(id)<\/code><\/strong> just takes <strong><code>id<\/code><\/strong> to perform <strong><code>deletion<\/code><\/strong>. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"638\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif\" alt=\"dexie_webkul-1\" class=\"wp-image-409084\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-300x159.gif 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-250x133.gif 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-768x408.gif 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1536x816.gif 1536w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><\/figure>\n\n\n\n<p><strong>Step 5: Importing into Route page&nbsp;:<br><\/strong>At this moment we&#8217;re just at the curve toward finish so in our last step, import <strong><code>StudentMngmt.tsx  <\/code><\/strong>the component into the route page here <\/p>\n\n\n\n<p>we&#8217;ve imported it into <code><strong>index.tsx<\/strong> <\/code>but it is your wish in which page you want to import. so the final result you can see below.<\/p>\n\n\n\n<p><strong>Conclusion<\/strong>: Integrating the <a href=\"https:\/\/dexie.org\/docs\/Tutorial\/Getting-started\" rel=\"nofollow\">Dexie<\/a> library into a Next.js application provides a powerful client-side database solution. <\/p>\n\n\n\n<p>Dexie simplifies the process of managing data on the client side, allowing for efficient storage and retrieval operations. By leveraging Dixie&#8217;s intuitive API and seamless<\/p>\n\n\n\n<p>Integration with Next.js, developers can create dynamic and responsive web applications with robust offline capabilities.<\/p>\n\n\n\n<p><br>Start your&nbsp;<a href=\"https:\/\/webkul.com\/headless-commerce-development-services\/\">Headless Development<\/a>&nbsp;with Webkul.<br>Happy Coding&nbsp;!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IndexedDB is a low-level API in web browsers that provides to store, retrieve, and perform transactions on large amounts of NoSQL data in the client&#8217;s browser. It&#8217;s designed for web application development that needs to work offline or require large amounts of data to be stored locally. Also, look no further and grab the opportunity <a href=\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":556,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13575,8931,6357],"tags":[15049,15048,12572],"class_list":["post-408761","post","type-post","status-publish","format-standard","hentry","category-next-js","category-pwa","category-react-js","tag-dexie","tag-indexeddb","tag-next-js"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to use indexedDB (Dexie) in NextJs - Webkul Blog<\/title>\n<meta name=\"description\" content=\"IndexedDB is a low-level API in web browsers that allows you to store, retrieve, and perform transactions on large amounts of structured ...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use indexedDB (Dexie) in NextJs - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"IndexedDB is a low-level API in web browsers that allows you to store, retrieve, and perform transactions on large amounts of structured ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-02T14:27:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-10T13:51:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif\" \/>\n<meta name=\"author\" content=\"Abhijeet Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abhijeet Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\"},\"author\":{\"name\":\"Abhijeet Kumar\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/b5a304024503b6ebcc17ca4eb99c4761\"},\"headline\":\"How to use indexedDB (Dexie) in NextJs\",\"datePublished\":\"2023-11-02T14:27:16+00:00\",\"dateModified\":\"2026-03-10T13:51:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\"},\"wordCount\":767,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif\",\"keywords\":[\"Dexie\",\"indexedDb\",\"Next.js\"],\"articleSection\":[\"next js\",\"PWA\",\"react js\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\",\"name\":\"How to use indexedDB (Dexie) in NextJs - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif\",\"datePublished\":\"2023-11-02T14:27:16+00:00\",\"dateModified\":\"2026-03-10T13:51:12+00:00\",\"description\":\"IndexedDB is a low-level API in web browsers that allows you to store, retrieve, and perform transactions on large amounts of structured ...\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1.gif\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1.gif\",\"width\":1920,\"height\":1020,\"caption\":\"dexie_webkul-1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use indexedDB (Dexie) in NextJs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/b5a304024503b6ebcc17ca4eb99c4761\",\"name\":\"Abhijeet Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7da15c87a9e02a6df1a4c86e9c28fdc2b835c30595c7476236c342bd212d70f8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7da15c87a9e02a6df1a4c86e9c28fdc2b835c30595c7476236c342bd212d70f8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Abhijeet Kumar\"},\"description\":\"Abhijeet is a skilled Software Engineer specializing in the Magento platform. With expertise in Magento 2 Headless Compatible Extensions and Headless PWA services, he crafts innovative solutions that enhance eCommerce functionality. A skilled developer, offering unique, headless solutions.\",\"url\":\"https:\/\/webkul.com\/blog\/author\/abhijit-kumar018\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to use indexedDB (Dexie) in NextJs - Webkul Blog","description":"IndexedDB is a low-level API in web browsers that allows you to store, retrieve, and perform transactions on large amounts of structured ...","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/","og_locale":"en_US","og_type":"article","og_title":"How to use indexedDB (Dexie) in NextJs - Webkul Blog","og_description":"IndexedDB is a low-level API in web browsers that allows you to store, retrieve, and perform transactions on large amounts of structured ...","og_url":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2023-11-02T14:27:16+00:00","article_modified_time":"2026-03-10T13:51:12+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif","type":"","width":"","height":""}],"author":"Abhijeet Kumar","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Abhijeet Kumar","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/"},"author":{"name":"Abhijeet Kumar","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/b5a304024503b6ebcc17ca4eb99c4761"},"headline":"How to use indexedDB (Dexie) in NextJs","datePublished":"2023-11-02T14:27:16+00:00","dateModified":"2026-03-10T13:51:12+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/"},"wordCount":767,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif","keywords":["Dexie","indexedDb","Next.js"],"articleSection":["next js","PWA","react js"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/","url":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/","name":"How to use indexedDB (Dexie) in NextJs - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1-1200x638.gif","datePublished":"2023-11-02T14:27:16+00:00","dateModified":"2026-03-10T13:51:12+00:00","description":"IndexedDB is a low-level API in web browsers that allows you to store, retrieve, and perform transactions on large amounts of structured ...","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1.gif","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2023\/11\/dexie_webkul-1.gif","width":1920,"height":1020,"caption":"dexie_webkul-1"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-use-indexeddb-dexie-in-nextjs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to use indexedDB (Dexie) in NextJs"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/b5a304024503b6ebcc17ca4eb99c4761","name":"Abhijeet Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7da15c87a9e02a6df1a4c86e9c28fdc2b835c30595c7476236c342bd212d70f8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7da15c87a9e02a6df1a4c86e9c28fdc2b835c30595c7476236c342bd212d70f8?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Abhijeet Kumar"},"description":"Abhijeet is a skilled Software Engineer specializing in the Magento platform. With expertise in Magento 2 Headless Compatible Extensions and Headless PWA services, he crafts innovative solutions that enhance eCommerce functionality. A skilled developer, offering unique, headless solutions.","url":"https:\/\/webkul.com\/blog\/author\/abhijit-kumar018\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/408761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/556"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=408761"}],"version-history":[{"count":53,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/408761\/revisions"}],"predecessor-version":[{"id":529901,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/408761\/revisions\/529901"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=408761"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=408761"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=408761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}