@@ -6,7 +6,8 @@ description:
66
77# 🏷️ Handle Schemas and Dataset Types
88
9- ** Schemas are like content labels that describe what's inside your protected data.**
9+ ** Schemas are like content labels that describe what's inside your protected
10+ data.**
1011
1112They define the structure and types of your data automatically when you protect
1213it, making it easy for iApps to know what they're working with.
@@ -48,17 +49,16 @@ console.log('📍 Address:', protectedData.address);
4849``` json
4950{
5051 "email" : " string" ,
51- "phoneNumber" : " string" ,
52+ "phoneNumber" : " string" ,
5253 "preferences" : {
5354 "newsletter" : " bool" ,
5455 "notifications" : " bool"
5556 }
5657}
5758```
5859
59- ::: info Schema Structure
60- The schema automatically maps your data structure to types that iApps can understand and validate.
61- :::
60+ ::: info Schema Structure The schema automatically maps your data structure to
61+ types that iApps can understand and validate. :::
6262
6363## Supported Data Types
6464
@@ -73,10 +73,8 @@ The schema automatically detects these types:
7373| ` application/octet-stream ` | Binary data | File contents |
7474| ` image/jpeg ` , ` image/png ` , etc. | Media files | Images, videos |
7575
76- ::: tip Auto-Detection
77- The SDK automatically detects file types based on
78- content. No need to specify MIME types manually.
79- :::
76+ ::: tip Auto-Detection The SDK automatically detects file types based on
77+ content. No need to specify MIME types manually. :::
8078
8179## Why Schemas Matter
8280
@@ -203,7 +201,7 @@ function createArrayBufferFromFile(file: File): Promise<ArrayBuffer> {
203201}
204202
205203// Get file from input element
206- const file = new File ([" " ], " example.jpg" , { type: " image/jpeg" });
204+ const file = new File ([' ' ], ' example.jpg' , { type: ' image/jpeg' });
207205
208206const web3Provider = getWeb3Provider (' PRIVATE_KEY' );
209207const dataProtectorCore = new IExecDataProtectorCore (web3Provider );
@@ -234,11 +232,9 @@ const fileData = await dataProtectorCore.protectData({
234232Once you have protected data with a schema, you'll want to process it inside an
235233iApp.
236234
237- ::: warning Type Matching
238- ** Your iApp and frontend must use the same field names
235+ ::: warning Type Matching ** Your iApp and frontend must use the same field names
239236and types.** If they don't match, you'll get runtime errors when processing the
240- data.
241- :::
237+ data. :::
242238
243239→ ** Ready to build an iApp?** Check out our detailed
244240[ Inputs and Outputs guide] ( /build-iapp/guides/inputs-and-outputs ) to learn how
0 commit comments