Support for the new file format in Sketch 43

A new file format was announced with the release of the public beta for Sketch 43. This file format was designed to allow better integration with third party services and external tools. Previous to this, developers could use SketchTool, an OS X command-line app for exporting pages and slices from Sketch files.

According to the announcement, new documents are basically zipped folders, containing JSON files that describe the document and also contains bitmap images and a document preview.

We’ve been toying around with the new file format and have just made support available to all applications in FilePreviews.

Here’s an example response of a request previewing a Sketch 43 sample document as well as metadata by specifying the sketch metadata option.

Note: The following has been truncated, but you can view the full file.

{
  "id": "53577c8d-891b-4be1-ad24-90dc507db189",
  "url": "https://api.filepreviews.io/v2/previews/53577c8d-891b-4be1-ad24-90dc507db189/",
  "status": "success",
  "preview": {
    "page": 1,
    "original_size": {
      "width": "2048",
      "height": "524"
    },
    "url": "https://s3.amazonaws.com/demo.filepreviews.io/7bd563270495e42957b0f16ac3050bcff739a2211a72763f5aac9341953ba431/preview_original-1.png",
    "requested_size": "original",
    "resized": false,
    "size": {
      "width": "2048",
      "height": "524"
    }
  },
  "thumbnails": [{
    "page": 1,
    "original_size": {
      "width": "2048",
      "height": "524"
    },
    "url": "https://s3.amazonaws.com/demo.filepreviews.io/7bd563270495e42957b0f16ac3050bcff739a2211a72763f5aac9341953ba431/preview_original-1.png",
    "requested_size": "original",
    "resized": false,
    "size": {
      "width": "2048",
      "height": "524"
    }
  }],
  "original_file": {
    "name": "Fitness App",
    "total_pages": 1,
    "encoding": "binary",
    "metadata": {
      "sketch": {
        "pages": {
          "1C01EF08-06C2-469A-8EB7-0BF12367FF6E": {
            "name": "Symbols",
            "isFlippedHorizontal": false,
            "exportOptions": {
              "_class": "exportOptions",
              "exportFormats": [],
              "includedLayerIds": [],
              "layerOptions": 0,
              "shouldTrim": false
            },
            "isLocked": false,
            "layerListExpandedType": 0,
            "hasClickThrough": true,
            "verticalRulerData": {
              "guides": [],
              "_class": "rulerData",
              "base": 0
            },
            "layers": [{
                  "name": "Time",
                  "isFlippedVertical": false,
                  "exportOptions": {
                    "_class": "exportOptions",
                    "exportFormats": [],
                    "includedLayerIds": [],
                    "layerOptions": 0,
                    "shouldTrim": false
                  },
                  "hasClickThrough": true,
                  "includeInCloudUpload": true,
                  "rotation": 0,
                  "horizontalRulerData": {
                    "guides": [],
                    "_class": "rulerData",
                    "base": 0
                  },
                  "style": {
                    "startDecorationType": 0,
                    "miterLimit": 10,
                    "_class": "style",
                    "endDecorationType": 0
                  },
                  "isFlippedHorizontal": false,
                  "includeBackgroundColorInExport": true,
                  "isLocked": false,
                  "verticalRulerData": {
                    "guides": [],
                    "_class": "rulerData",
                    "base": 0
                  },
                  "layers": [{
                        "name": "18:34",
                        "exportOptions": {
                          "_class": "exportOptions",
                          "exportFormats": [],
                          "includedLayerIds": [],
                          "layerOptions": 0,
                          "shouldTrim": false
                        },
                        "rotation": 0,
                        "dontSynchroniseWithSymbol": true,

We’re looking forward to see how this file format evolves and what developers can do with it. Send us a note to support@filepreviews.io if you’re looking to use this to build something cool, have any questions or feedback.