CINXE.COM
Runtime Client | Twilio
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width"/><title>Runtime Client | Twilio</title><meta name="description" content="Learn how to use the Runtime Client to refactor and manage Twilio Functions, Assets, and real-time data in your Serverless applications."/><link rel="canonical" href="https://www.twilio.com/docs/serverless/functions-assets/client"/><meta name="next-head-count" content="5"/><link rel="preconnect" href="https://assets.twilio.com"/><script async="" defer="" src="https://consent.trustarc.com/notice?domain=twilio.com&c=teconsent&gtm=1&js=nj&noticeType=bb"></script><meta name="x-twilio-docs-source" content="primary"/><link rel="preload" href="/_next/static/css/12418e876151f57e.css?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" as="style"/><link rel="stylesheet" href="/_next/static/css/12418e876151f57e.css?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe"></script><script src="/_next/static/chunks/webpack-d3ec386faefbf024.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/chunks/framework-d65b0fe30fbe55da.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/chunks/main-67108fd261318eed.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/chunks/pages/_app-b2bc32db37b22173.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/chunks/398-ebbc0d3c0be7d4a4.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/chunks/741-af6e3e21307ad8e9.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/chunks/pages/docs/%5B...path%5D-c5c89aaab05f1efc.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/nWtU_5WJsvLGK2x62E_3J/_buildManifest.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script><script src="/_next/static/nWtU_5WJsvLGK2x62E_3J/_ssgManifest.js?dpl=dpl_3ZuqWh1QtrSXCRJG4oqPP5VViMwe" defer=""></script></head><body><div id="__next"><style data-emotion="css-global lbobjb">html{font-size:100%;font-family:'TwilioSansText','Inter var experimental','Inter var',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;}html:lang(ja) .paste-theme-provider,html:lang(ja-JP) .paste-theme-provider{font-family:'Inter var experimental','Inter var',Hiragino Sans,'ヒラギノ角ゴ ProN W3','Hiragino Kaku Gothic ProN','メイリオ',Meiryo,Osaka,'MS PGothic',sans-serif;}html:lang(zh-CN) .paste-theme-provider{font-family:'Inter var experimental','Inter var','Microsoft YaHei New',微软雅黑,'Microsoft Yahei','Microsoft JhengHei',宋体,SimSun,sans-serif;}html:lang(zh-TW) .paste-theme-provider,html:lang(zh-HK) .paste-theme-provider{font-family:'Inter var experimental','Inter var','Microsoft JhengHei',微軟正黑體,'Microsoft JhengHei UI','Microsoft YaHei',微軟雅黑,宋体,SimSun,sans-serif;}html:lang(ko) .paste-theme-provider{font-family:'Inter var experimental','Inter var','Microsoft JhengHei',微軟正黑體,'Microsoft JhengHei UI','Microsoft YaHei',微軟雅黑,宋体,SimSun,sans-serif;}body{background-color:rgb(255, 255, 255);margin:0;}*,*::after,*::before{box-sizing:border-box;}@media (prefers-reduced-motion: reduce){*{-webkit-animation-duration:0!important;animation-duration:0!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important;transition-duration:0!important;scroll-behavior:auto!important;}}:root{--reach-dialog:1;}</style><style data-emotion="css-global 1uje5tv">@font-face{font-family:'Inter var';font-weight:100 900;font-display:swap;font-style:normal;font-named-instance:'Regular';src:url("https://assets.twilio.com/public_assets/paste-fonts/1.5.2/Inter-roman.var.woff2?v=3.19") format("woff2");}@font-face{font-family:'Inter var';font-weight:100 900;font-display:swap;font-style:italic;font-named-instance:'Italic';src:url("https://assets.twilio.com/public_assets/paste-fonts/1.5.2/Inter-italic.var.woff2?v=3.19") format("woff2");}@font-face{font-family:'Inter var experimental';font-weight:100 900;font-display:swap;font-style:oblique 0deg 8deg;src:url("https://assets.twilio.com/public_assets/paste-fonts/1.5.2/Inter.var.woff2?v=3.19") format("woff2");}@font-face{font-family:'TwilioSansMono';font-style:normal;font-display:swap;font-weight:400;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-Regular.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-Regular.woff') format('woff');}@font-face{font-family:'TwilioSansMono';font-style:italic;font-display:swap;font-weight:400;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-RegularItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-RegularItl.woff') format('woff');}@font-face{font-family:'TwilioSansMono';font-style:normal;font-display:swap;font-weight:700;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-Bold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-Bold.woff') format('woff');}@font-face{font-family:'TwilioSansMono';font-style:italic;font-display:swap;font-weight:700;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-BoldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-BoldItl.woff') format('woff');}@font-face{font-family:'TwilioSansMono';font-style:normal;font-display:swap;font-weight:500;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-Medium.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-Medium.woff') format('woff');}@font-face{font-family:'TwilioSansMono';font-style:italic;font-display:swap;font-weight:500;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-MediumItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansMono-MediumItl.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:normal;font-display:swap;font-weight:300;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Light.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Light.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:italic;font-display:swap;font-weight:300;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-LightItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-LightItl.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:normal;font-display:swap;font-weight:400;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Regular.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Regular.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:italic;font-display:swap;font-weight:400;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-RegularItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-RegularItl.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:normal;font-display:swap;font-weight:500;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Medium.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Medium.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:italic;font-display:swap;font-weight:500;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-MediumItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-MediumItl.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:normal;font-display:swap;font-weight:600;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Semibold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Semibold.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:italic;font-display:swap;font-weight:600;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-SemiboldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-SemiboldItl.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:normal;font-display:swap;font-weight:700;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Bold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Bold.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:italic;font-display:swap;font-weight:700;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-BoldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-BoldItl.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:normal;font-display:swap;font-weight:800;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Extrabold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-Extrabold.woff') format('woff');}@font-face{font-family:'TwilioSansText';font-style:italic;font-display:swap;font-weight:800;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-ExtraboldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansText-ExtraboldItl.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:normal;font-display:swap;font-weight:300;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Light.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Light.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:italic;font-display:swap;font-weight:300;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-LightItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-LightItl.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:normal;font-display:swap;font-weight:400;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Regular.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Regular.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:italic;font-display:swap;font-weight:400;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-RegularItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-RegularItl.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:normal;font-display:swap;font-weight:500;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Medium.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Medium.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:italic;font-display:swap;font-weight:500;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-MediumItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-MediumItl.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:normal;font-display:swap;font-weight:600;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Semibold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Semibold.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:italic;font-display:swap;font-weight:600;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-SemiboldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-SemiboldItl.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:normal;font-display:swap;font-weight:700;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Bold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Bold.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:italic;font-display:swap;font-weight:700;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-BoldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-BoldItl.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:normal;font-display:swap;font-weight:800;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Extrabold.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-Extrabold.woff') format('woff');}@font-face{font-family:'TwilioSansDisplay';font-style:italic;font-display:swap;font-weight:800;src:local(''),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-ExtraboldItl.woff2') format('woff2'),url('https://assets.twilio.com/public_assets/paste-fonts/1.5.2/TwilioSansDisplay-ExtraboldItl.woff') format('woff');}</style><style data-emotion="css 1pzojz9">.css-1pzojz9{color:rgb(18, 28, 45);-webkit-print-color-scheme:light;color-scheme:light;font-size:0.875rem;font-family:'TwilioSansText','Inter var experimental','Inter var',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;line-height:1.25rem;font-weight:400;font-variant-numeric:tabular-nums;}</style><div class="paste-theme-provider css-1pzojz9"><style data-emotion="css-global lbobjb">html{font-size:100%;font-family:'TwilioSansText','Inter var experimental','Inter var',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;}html:lang(ja) .paste-theme-provider,html:lang(ja-JP) .paste-theme-provider{font-family:'Inter var experimental','Inter var',Hiragino Sans,'ヒラギノ角ゴ ProN W3','Hiragino Kaku Gothic ProN','メイリオ',Meiryo,Osaka,'MS PGothic',sans-serif;}html:lang(zh-CN) .paste-theme-provider{font-family:'Inter var experimental','Inter var','Microsoft YaHei New',微软雅黑,'Microsoft Yahei','Microsoft JhengHei',宋体,SimSun,sans-serif;}html:lang(zh-TW) .paste-theme-provider,html:lang(zh-HK) .paste-theme-provider{font-family:'Inter var experimental','Inter var','Microsoft JhengHei',微軟正黑體,'Microsoft JhengHei UI','Microsoft YaHei',微軟雅黑,宋体,SimSun,sans-serif;}html:lang(ko) .paste-theme-provider{font-family:'Inter var experimental','Inter var','Microsoft JhengHei',微軟正黑體,'Microsoft JhengHei UI','Microsoft YaHei',微軟雅黑,宋体,SimSun,sans-serif;}body{background-color:rgb(255, 255, 255);margin:0;}*,*::after,*::before{box-sizing:border-box;}@media (prefers-reduced-motion: reduce){*{-webkit-animation-duration:0!important;animation-duration:0!important;-webkit-animation-iteration-count:1!important;animation-iteration-count:1!important;transition-duration:0!important;scroll-behavior:auto!important;}}:root{--reach-dialog:1;}</style><div class="css-1pzojz9"><style data-emotion="css-global 10ozouv">*{font-variant-ligatures:none;font-feature-settings:"liga" 0;}.DocSearch-Button{background-color:rgb(255, 255, 255);border-radius:4px;box-shadow:0 0 0 1px #8891aa;color:rgb(96, 107, 133);padding-left:0.75rem;padding-right:0.75rem;margin:0;width:100%;}.DocSearch-Button:hover{box-shadow:0 0 0 1px #006dfa;}.DocSearch-Button:active,.DocSearch-Button:focus{box-shadow:0 0 0 1px #cacdd8,0 0 0 3px #ffffff,0 0 0 4px #006dfa,0 0 0 6px #cce4ff;}.DocSearch-Button .DocSearch-Search-Icon{color:rgb(96, 107, 133);width:1rem;height:1rem;}.DocSearch-Button-Placeholder{font-size:0.875rem;font-family:'TwilioSansText','Inter var experimental','Inter var',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-weight:500;font-style:italic;padding-left:0.75rem;padding-right:0.75rem;}.DocSearch-Button-Key{top:0;padding-bottom:0;}.DocSearch-Container{color:rgb(18, 28, 45);-webkit-print-color-scheme:light;color-scheme:light;font-size:0.875rem;font-family:'TwilioSansText','Inter var experimental','Inter var',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;line-height:1.25rem;font-weight:400;font-variant-numeric:tabular-nums;}.DocSearch-Dropdown a{color:rgb(2, 99, 224);-webkit-text-decoration:underline;text-decoration:underline;}.DocSearch-Dropdown a:hover{-webkit-text-decoration:none;text-decoration:none;}.DocSearch-SearchBar{padding-bottom:0.25rem;}.DocSearch-Search-Icon{color:rgb(96, 107, 133);}.DocSearch-Input{padding-left:1rem;}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{width:1rem;height:1rem;}.DocSearch-Hits mark{color:rgb(2, 99, 224);}.DocSearch-Hit{padding-bottom:0.5rem;}.DocSearch-Hit a{border-color:rgb(225, 227, 234);border-style:solid;border-width:2px;-webkit-text-decoration:none;text-decoration:none;}.DocSearch-Hit[aria-selected=true] a{border-color:rgb(3, 11, 93);}.DocSearch-Hit-title{font-size:0.875rem;}.DocSearch-Hit-path{font-size:0.75rem;}.DocSearch-Hit-source{color:rgb(18, 28, 45);font-size:0.875rem;font-weight:500;}.DocSearch-Hit-icon{display:none;}.DocSearch-Prefill{color:rgb(2, 99, 224);-webkit-text-decoration:underline;text-decoration:underline;}.DocSearch-Prefill:hover{-webkit-text-decoration:none;text-decoration:none;}.DocSearch-Commands-Key{padding-bottom:0;}:root{--docsearch-primary-color:rgb(3, 11, 93);--docsearch-text-color:rgb(18, 28, 45);--docsearch-spacing:1rem;--docsearch-icon-stroke-width:2px;--docsearch-highlight-color:rgb(3, 11, 93);--docsearch-muted-color:rgb(96, 107, 133);--docsearch-container-background:rgba(96, 107, 133, 0.5);--docsearch-logo-color:rgb(96, 107, 133);--docsearch-modal-width:44.5rem;--docsearch-modal-height:600px;--docsearch-modal-background:rgb(255, 255, 255);--docsearch-modal-shadow:0 2px 8px 0 rgba(18, 28, 45, 0.1);--docsearch-searchbox-height:46px;--docsearch-searchbox-background:rgb(18, 28, 45);--docsearch-searchbox-focus-background:rgb(255, 255, 255);--docsearch-searchbox-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;--docsearch-hit-height:56px;--docsearch-hit-color:rgb(18, 28, 45);--docsearch-hit-active-color:rgb(255, 255, 255);--docsearch-hit-background:rgb(255, 255, 255);--docsearch-hit-shadow:none;--docsearch-key-gradient:rgb(244, 244, 246);--docsearch-key-shadow:none;--docsearch-footer-height:44px;--docsearch-footer-background:rgb(255, 255, 255);--docsearch-footer-shadow:none;}html{scroll-behavior:smooth;scroll-padding-top:100px;}@media (max-width: 1385px){html{scroll-padding-top:156px;}}.grecaptcha-badge{visibility:hidden;}</style><style data-emotion="css 12lwncy">.css-12lwncy{box-sizing:border-box;opacity:0;transition-delay:50ms;-webkit-transition:opacity 150ms ease;transition:opacity 150ms ease;position:relative;z-index:40;}@media screen and (min-width: 768px){.css-12lwncy{opacity:1;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-12lwncy"><style data-emotion="css 1rkak9m">.css-1rkak9m{box-sizing:border-box;background-color:rgb(255, 255, 255);border-radius:4px;box-shadow:0 2px 8px 0 rgba(18, 28, 45, 0.1);left:10px;padding-left:1.25rem;padding-right:1.25rem;padding-top:0.5rem;padding-bottom:0.5rem;position:fixed;top:10px;-webkit-transform:translateY(-150%);-moz-transform:translateY(-150%);-ms-transform:translateY(-150%);transform:translateY(-150%);-webkit-transition:-webkit-transform 0.1s;transition:transform 0.1s;z-index:90;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-column-gap:1.25rem;column-gap:1.25rem;}.css-1rkak9m:focus-within{-webkit-transform:translateY(0%);-moz-transform:translateY(0%);-ms-transform:translateY(0%);transform:translateY(0%);}</style><div data-paste-element="SIDEBAR_SKIPLINKS" data-paste-core-version="20.7.0" class="css-1rkak9m"><style data-emotion="css lpeit6">.css-lpeit6{box-sizing:border-box;color:rgb(2, 99, 224);font-size:inherit;font-weight:inherit;line-height:inherit;outline:none;-webkit-text-decoration:underline;text-decoration:underline;}.css-lpeit6:active,.css-lpeit6[data-active=true]{color:rgb(6, 3, 58);-webkit-text-decoration:none;text-decoration:none;}.css-lpeit6:focus{box-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;color:rgb(2, 99, 224);-webkit-text-decoration:underline;text-decoration:underline;border-radius:4px;}.css-lpeit6:hover{color:rgb(3, 11, 93);-webkit-text-decoration:none;text-decoration:none;}</style><a data-paste-element="SIDEBAR_SKIPLINKS_LINK" data-paste-core-version="20.7.0" href="#twilio-docs-content-area" class="css-lpeit6">Skip to content</a><a data-paste-element="SIDEBAR_SKIPLINKS_LINK" data-paste-core-version="20.7.0" href="#twilio-docs-sidebar-nav" class="css-lpeit6">Skip to navigation</a><a data-paste-element="SIDEBAR_SKIPLINKS_LINK" data-paste-core-version="20.7.0" href="#twilio-docs-topbar" class="css-lpeit6">Skip to topbar</a></div><style data-emotion="css 1ngeyxk">.css-1ngeyxk{box-sizing:border-box;width:100%;overflow:visible;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;border-right-style:solid;border-right-width:1px;border-right-color:rgb(57, 71, 98);background-color:rgb(18, 28, 45);z-index:50;position:fixed;top:0;left:0;bottom:0;}@media screen and (min-width: 768px){.css-1ngeyxk{width:15rem;}}</style><aside data-paste-element="SIDEBAR" data-paste-core-version="20.7.0" style="opacity:1;width:15rem;transform:translateX(0%)" id=":R2lasm:" class="css-1ngeyxk"><style data-emotion="css 144b354">.css-144b354{box-sizing:border-box;padding-left:1.25rem;padding-right:1.25rem;min-height:4.75rem;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(57, 71, 98);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-column-gap:1rem;column-gap:1rem;overflow:hidden;}</style><div data-paste-element="SIDEBAR_HEADER" data-paste-core-version="20.7.0" class="css-144b354"><style data-emotion="css 16k9fbc">.css-16k9fbc{box-sizing:border-box;width:auto;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;display:inline-block;border:none;outline:none;-webkit-transition:background-color 100ms ease-in,box-shadow 100ms ease-in,color 100ms ease-in;transition:background-color 100ms ease-in,box-shadow 100ms ease-in,color 100ms ease-in;font-family:inherit;font-weight:600;-webkit-text-decoration:none;text-decoration:none;position:relative;margin:0;border-radius:4px;cursor:pointer;color:rgb(255, 255, 255);background-color:rgb(18, 28, 45);box-shadow:0 0 0 1px #394762;padding:0.5rem;}.css-16k9fbc:hover{-webkit-text-decoration:none;text-decoration:none;color:rgb(255, 255, 255);background-color:rgb(31, 48, 76);box-shadow:0 0 0 1px #f4f4f6;}.css-16k9fbc:focus{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #394762,0 0 0 3px #121c2d,0 0 0 4px #ffffff,0 0 0 6px rgba(255, 255, 255, 0.2);}.css-16k9fbc:active,.css-16k9fbc[data-active=true]{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #ffffff;color:rgb(255, 255, 255);background-color:rgb(31, 48, 76);}</style><a data-paste-element="SIDEBAR_HEADER_ICON_BUTTON" data-paste-core-version="20.7.0" href="/docs" type="button" aria-busy="false" class="css-16k9fbc"><style data-emotion="css 1lgr57j">.css-1lgr57j{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-text-decoration:inherit;text-decoration:inherit;opacity:1;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-column-gap:0.25rem;column-gap:0.25rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><style data-emotion="css pe4vrq">.css-pe4vrq{box-sizing:border-box;line-height:0;display:block;color:currentColor;width:1.25rem;height:1.25rem;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}</style><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LogoTwilioIcon-:R9j6mlasm:"><title id="LogoTwilioIcon-:R9j6mlasm:">Go to the Twilio Docs home page</title><path fill="currentColor" fill-rule="evenodd" d="M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10A10 10 0 0010 0zm0 17.333a7.333 7.333 0 110-14.666 7.333 7.333 0 010 14.666zm4.533-9.8a2.067 2.067 0 11-2.066-2.066 2.08 2.08 0 012.066 2.066zm0 4.934a2.067 2.067 0 11-2.066-2.067 2.08 2.08 0 012.066 2.067zm-4.933 0A2.067 2.067 0 117.533 10.4 2.08 2.08 0 019.6 12.467zm0-4.934a2.067 2.067 0 11-2.067-2.066A2.08 2.08 0 019.6 7.533z"></path></svg></span></span></a><style data-emotion="css bt2jq2">.css-bt2jq2{box-sizing:border-box;opacity:1;font-size:0.875rem;font-weight:600;line-height:1.25rem;letter-spacing:-.02em;color:rgb(255, 255, 255);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;margin:0;}</style><div data-paste-element="SIDEBAR_HEADER_LABEL" data-paste-core-version="20.7.0" class="css-bt2jq2">Twilio Docs</div></div><style data-emotion="css 1r1miiz">.css-1r1miiz{box-sizing:border-box;max-height:100%;overflow:hidden;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}</style><div data-paste-element="SIDEBAR_BODY" data-paste-core-version="20.7.0" class="css-1r1miiz"><style data-emotion="css 1j8kdpc">.css-1j8kdpc{box-sizing:border-box;-webkit-transition:opacity 150ms ease;transition:opacity 150ms ease;max-height:100%;overflow-y:auto;overflow-x:hidden;padding-top:1rem;padding-bottom:1rem;padding-left:1.25rem;padding-right:1.25rem;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}</style><style data-emotion="css 1jrfwwl">.css-1jrfwwl{overflow-scrolling:touch;background:linear-gradient(rgb(18, 28, 45) 33%, rgba(20,28,44, 0)),linear-gradient(rgba(20,28,44, 0), rgb(18, 28, 45) 66%) 0 100%,radial-gradient(farthest-side at 50% 100%, rgba(57, 71, 98, 0.5), rgba(0,0,0,0)) 0 100%;background-repeat:no-repeat;-webkit-background-size:100% 15px,100% 15px,100% 5px,100% 5px;background-size:100% 15px,100% 15px,100% 5px,100% 5px;background-attachment:local,local,scroll,scroll;box-sizing:border-box;-webkit-transition:opacity 150ms ease;transition:opacity 150ms ease;max-height:100%;overflow-y:auto;overflow-x:hidden;padding-top:1rem;padding-bottom:1rem;padding-left:1.25rem;padding-right:1.25rem;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}.css-1jrfwwl::-webkit-scrollbar{width:6px;}.css-1jrfwwl::-webkit-scrollbar-track{margin-top:8px;background:rgb(18, 28, 45);}.css-1jrfwwl::-webkit-scrollbar-thumb{background:rgb(57, 71, 98);border-radius:10px;}.css-1jrfwwl::-webkit-scrollbar-thumb:hover{background:rgb(57, 71, 98);}</style><nav data-paste-element="SIDEBAR_NAVIGATION" data-paste-core-version="20.7.0" aria-label="main" id="twilio-docs-sidebar-nav" class="css-1jrfwwl"><style data-emotion="css 4zrz0j">.css-4zrz0j{box-sizing:border-box;font-style:normal;font-weight:400;font-size:0.875rem;line-height:1.25rem;color:rgb(202, 205, 216);-webkit-transition:all 120ms ease;transition:all 120ms ease;border-radius:4px;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:0.5rem;column-gap:0.5rem;outline:none;padding-top:0.5rem;padding-bottom:0.5rem;position:relative;-webkit-text-decoration:none;text-decoration:none;background:none;border:none;overflow:hidden;padding-left:1.5rem;padding-right:0.5rem;margin-bottom:0.5rem;width:100%;}.css-4zrz0j:focus{box-shadow:0 0 0 1px #ffffff,inset 0 0 0 3px rgba(255, 255, 255, 0.2);}.css-4zrz0j:hover{-webkit-text-decoration:underline;text-decoration:underline;}</style><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets" class="css-4zrz0j"><style data-emotion="css qxhhlx">.css-qxhhlx{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-column-gap:0.25rem;column-gap:0.25rem;-webkit-transition:all 120ms ease;transition:all 120ms ease;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;float:none;opacity:1;white-space:normal;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Functions and Assets</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless" class="css-4zrz0j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Return to Serverless overview</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions" class="css-4zrz0j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Overview</span></a><style data-emotion="css 17onuso">.css-17onuso{box-sizing:border-box;display:block;margin-bottom:0.5rem;}</style><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE" data-paste-core-version="20.7.0" class="css-17onuso"><style data-emotion="css 1icrb9o">.css-1icrb9o{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-column-gap:0.5rem;column-gap:0.5rem;}</style><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_WRAPPER" data-paste-core-version="20.7.0" class="css-1icrb9o"><style data-emotion="css 1vx51jp">.css-1vx51jp{box-sizing:border-box;font-style:normal;font-weight:400;font-size:0.875rem;line-height:1.25rem;color:rgb(202, 205, 216);-webkit-transition:all 120ms ease;transition:all 120ms ease;border-radius:4px;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:0.25rem;column-gap:0.25rem;outline:none;padding-top:0.5rem;padding-bottom:0.5rem;position:relative;-webkit-text-decoration:none;text-decoration:none;}.css-1vx51jp:focus{box-shadow:0 0 0 1px #ffffff,inset 0 0 0 3px rgba(255, 255, 255, 0.2);}</style><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING" data-paste-core-version="20.7.0" type="button" aria-expanded="false" aria-controls=":Rqlamlasm:" class="css-1vx51jp"><style data-emotion="css f76d15">.css-f76d15{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:rgb(136, 145, 170);height:1.25rem;width:1.25rem;-webkit-transition:-webkit-transform 150ms ease;transition:transform 150ms ease;-webkit-transform:translateX(0) rotate(0deg);-moz-transform:translateX(0) rotate(0deg);-ms-transform:translateX(0) rotate(0deg);transform:translateX(0) rotate(0deg);}</style><span data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_EXPAND_ICON" data-paste-core-version="20.7.0" class="css-f76d15"><style data-emotion="css pft8gl">.css-pft8gl{box-sizing:border-box;line-height:0;display:block;color:inherit;width:1.25rem;height:1.25rem;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}</style><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pft8gl"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" aria-labelledby="ChevronDisclosureIcon-:Rj9kqlamlasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.707 6.293a1 1 0 00-1.497 1.32l.083.094L10.585 10l-2.292 2.293a1 1 0 00-.083 1.32l.083.094a1 1 0 001.32.083l.094-.083 3-3a1 1 0 00.083-1.32l-.083-.094-3-3z"></path></svg></span></span><style data-emotion="css 1m2bqrv">.css-1m2bqrv{box-sizing:border-box;display:block;margin-left:0.25rem;-webkit-transition:all 120ms ease;transition:all 120ms ease;float:none;opacity:1;white-space:normal;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m2bqrv">Technical concepts</span></div></div><style data-emotion="css 1nm6rmy">.css-1nm6rmy{box-sizing:border-box;padding-left:1.5rem;color:rgb(202, 205, 216);margin-top:0.25rem;}</style><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_CONTENT" data-paste-core-version="20.7.0" id=":Rqlamlasm:" hidden="" style="display:none" class="css-1nm6rmy"><style data-emotion="css lafmnu">.css-lafmnu{box-sizing:border-box;font-style:normal;font-weight:400;font-size:0.75rem;line-height:1.25rem;color:rgb(202, 205, 216);-webkit-transition:all 120ms ease;transition:all 120ms ease;border-radius:4px;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:0.5rem;column-gap:0.5rem;outline:none;padding-top:0.25rem;padding-bottom:0.25rem;position:relative;-webkit-text-decoration:none;text-decoration:none;background:none;border:none;overflow:hidden;padding-left:1.75rem;padding-right:0.5rem;margin-bottom:0.25rem;width:100%;}.css-lafmnu:focus{box-shadow:0 0 0 1px #ffffff,inset 0 0 0 3px rgba(255, 255, 255, 0.2);}.css-lafmnu:hover{-webkit-text-decoration:underline;text-decoration:underline;}</style><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/request-flow" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Function request flow</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/invocation" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Function execution</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/visibility" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Visibility of Functions and Assets</span></a></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE" data-paste-core-version="20.7.0" class="css-17onuso"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_WRAPPER" data-paste-core-version="20.7.0" class="css-1icrb9o"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING" data-paste-core-version="20.7.0" type="button" aria-expanded="false" aria-controls=":R12lamlasm:" class="css-1vx51jp"><span data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_EXPAND_ICON" data-paste-core-version="20.7.0" class="css-f76d15"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pft8gl"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" aria-labelledby="ChevronDisclosureIcon-:Rj9l2lamlasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.707 6.293a1 1 0 00-1.497 1.32l.083.094L10.585 10l-2.292 2.293a1 1 0 00-.083 1.32l.083.094a1 1 0 001.32.083l.094-.083 3-3a1 1 0 00.083-1.32l-.083-.094-3-3z"></path></svg></span></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m2bqrv">Get started</span></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_CONTENT" data-paste-core-version="20.7.0" id=":R12lamlasm:" hidden="" style="display:none" class="css-1nm6rmy"><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/create-service" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Create a Service</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/assets" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Assets</span></a></div></div><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/labs/serverless-toolkit" class="css-4zrz0j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx"><span>Serverless Toolkit</span><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LinkExternalIcon-:Rl9alamlasm:"><path fill="currentColor" fill-rule="evenodd" d="M8.4 4.5a.5.5 0 01.5.5v.1a.5.5 0 01-.5.5H5.6v8.8h8.8v-2.8a.5.5 0 01.41-.492l.09-.008h.1a.5.5 0 01.492.41l.008.09V15a.5.5 0 01-.41.492L15 15.5H5a.5.5 0 01-.492-.41L4.5 15V5a.5.5 0 01.41-.492L5 4.5h3.4zm6.6 0a.5.5 0 01.5.5v.1l-.001.01.001 3.29a.5.5 0 01-.5.5h-.1a.5.5 0 01-.5-.5l-.001-1.935-3.967 3.967a.611.611 0 01-.78.07l-.084-.07a.611.611 0 01-.07-.78l.07-.084L13.534 5.6H11.6a.5.5 0 01-.5-.5V5a.5.5 0 01.5-.5H15z"></path></svg></span></span></a><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE" data-paste-core-version="20.7.0" class="css-17onuso"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_WRAPPER" data-paste-core-version="20.7.0" class="css-1icrb9o"><style data-emotion="css ecye55">.css-ecye55{box-sizing:border-box;font-style:normal;font-weight:600;font-size:0.875rem;line-height:1.25rem;color:rgb(255, 255, 255);-webkit-transition:all 120ms ease;transition:all 120ms ease;border-radius:4px;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:0.25rem;column-gap:0.25rem;outline:none;padding-top:0.5rem;padding-bottom:0.5rem;position:relative;-webkit-text-decoration:none;text-decoration:none;}.css-ecye55:focus{box-shadow:0 0 0 1px #ffffff,inset 0 0 0 3px rgba(255, 255, 255, 0.2);}</style><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING" data-paste-core-version="20.7.0" type="button" aria-expanded="true" aria-controls=":R1ilamlasm:" class="css-ecye55"><style data-emotion="css 127bfmf">.css-127bfmf{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;color:rgb(136, 145, 170);height:1.25rem;width:1.25rem;-webkit-transition:-webkit-transform 150ms ease;transition:transform 150ms ease;-webkit-transform:translateX(0) rotate(90deg);-moz-transform:translateX(0) rotate(90deg);-ms-transform:translateX(0) rotate(90deg);transform:translateX(0) rotate(90deg);}</style><span data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_EXPAND_ICON" data-paste-core-version="20.7.0" class="css-127bfmf"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pft8gl"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" aria-labelledby="ChevronDisclosureIcon-:Rj9lilamlasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.707 6.293a1 1 0 00-1.497 1.32l.083.094L10.585 10l-2.292 2.293a1 1 0 00-.083 1.32l.083.094a1 1 0 001.32.083l.094-.083 3-3a1 1 0 00.083-1.32l-.083-.094-3-3z"></path></svg></span></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m2bqrv">Developer guides</span></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_CONTENT" data-paste-core-version="20.7.0" id=":R1ilamlasm:" class="css-1nm6rmy"><style data-emotion="css bxygmn">.css-bxygmn{box-sizing:border-box;font-style:normal;font-weight:600;font-size:0.75rem;line-height:1.25rem;color:rgb(255, 255, 255);-webkit-transition:all 120ms ease;transition:all 120ms ease;border-radius:4px;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:0.5rem;column-gap:0.5rem;outline:none;padding-top:0.25rem;padding-bottom:0.25rem;position:relative;-webkit-text-decoration:none;text-decoration:none;background:none;border:none;overflow:hidden;padding-left:1.75rem;padding-right:0.5rem;margin-bottom:0.25rem;width:100%;background-color:rgb(31, 48, 76);}.css-bxygmn:focus{box-shadow:0 0 0 1px #ffffff,inset 0 0 0 3px rgba(255, 255, 255, 0.2);}.css-bxygmn:hover{-webkit-text-decoration:underline;text-decoration:underline;}</style><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/client" aria-current="page" class="css-bxygmn"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Runtime Client</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/handler" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Runtime Handler</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/variables" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Environment variables</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/dependencies" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Dependencies</span></a><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE" data-paste-core-version="20.7.0" class="css-17onuso"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_WRAPPER" data-paste-core-version="20.7.0" class="css-1icrb9o"><style data-emotion="css q9if6j">.css-q9if6j{box-sizing:border-box;font-style:normal;font-weight:400;font-size:0.75rem;line-height:1.25rem;color:rgb(202, 205, 216);-webkit-transition:all 120ms ease;transition:all 120ms ease;border-radius:4px;cursor:pointer;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:0.25rem;column-gap:0.25rem;outline:none;padding-top:0.25rem;padding-bottom:0.25rem;position:relative;-webkit-text-decoration:none;text-decoration:none;}.css-q9if6j:focus{box-shadow:0 0 0 1px #ffffff,inset 0 0 0 3px rgba(255, 255, 255, 0.2);}</style><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING" data-paste-core-version="20.7.0" type="button" aria-expanded="false" aria-controls=":R2qlilamlasm:" class="css-q9if6j"><span data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_EXPAND_ICON" data-paste-core-version="20.7.0" class="css-f76d15"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pft8gl"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" aria-labelledby="ChevronDisclosureIcon-:Rj9mqlilamlasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.707 6.293a1 1 0 00-1.497 1.32l.083.094L10.585 10l-2.292 2.293a1 1 0 00-.083 1.32l.083.094a1 1 0 001.32.083l.094-.083 3-3a1 1 0 00.083-1.32l-.083-.094-3-3z"></path></svg></span></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m2bqrv">Headers and cookies</span></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_CONTENT" data-paste-core-version="20.7.0" id=":R2qlilamlasm:" hidden="" style="display:none" class="css-1nm6rmy"><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/headers-and-cookies" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Overview</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/headers-and-cookies/access" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Access values</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/headers-and-cookies/setting-and-modifying" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Set and modify values</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/headers-and-cookies/limitations" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Limitations</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart#learn-how-headers-and-cookies-can-add-extra-functionality-and-security" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Examples</span></a></div></div><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/debugging" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Debugging</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/faq" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Frequently asked questions</span></a></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE" data-paste-core-version="20.7.0" class="css-17onuso"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_WRAPPER" data-paste-core-version="20.7.0" class="css-1icrb9o"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING" data-paste-core-version="20.7.0" type="button" aria-expanded="false" aria-controls=":R1qlamlasm:" class="css-1vx51jp"><span data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_EXPAND_ICON" data-paste-core-version="20.7.0" class="css-f76d15"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pft8gl"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" aria-labelledby="ChevronDisclosureIcon-:Rj9lqlamlasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.707 6.293a1 1 0 00-1.497 1.32l.083.094L10.585 10l-2.292 2.293a1 1 0 00-.083 1.32l.083.094a1 1 0 001.32.083l.094-.083 3-3a1 1 0 00.083-1.32l-.083-.094-3-3z"></path></svg></span></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m2bqrv">Examples</span></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_CONTENT" data-paste-core-version="20.7.0" id=":R1qlamlasm:" hidden="" style="display:none" class="css-1nm6rmy"><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/receive-sms" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Receive an inbound SMS</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/send-sms-and-mms" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Send SMS and MMS</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/receive-call" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Receive an incoming phone call</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/make-a-call" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Make a Call</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/api-request" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Make an API request</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/run-function-studio-widget" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Use the Run Function widget in Studio</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/real-time-data-sync" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Handle real-time data with Twilio Sync</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/basic-auth" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Protect your Function with Basic Auth</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/json-web-token" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Protect your Function with JSON Web Token</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/cookies-state" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Manage application state with cookies</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/validate-webhook-requests-from-sendgrid" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Validate Webhook requests from SendGrid</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/enabling-cors-between-flex-plugins-and-functions" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Enable CORS between Flex Plugins and Functions</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/add-delay" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Add delay</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/lookup-carrier-and-caller-info" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Determine carrier, phone number type, and caller info</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/time-of-day-routing" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Time of day routing with Functions</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/normalize-telephone-numbers" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Normalize telephone numbers</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/blocked-numbers" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Prevent blocked numbers from calling your application</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/display-versions" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Display Node.js and Twilio Helper Library versions</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/how-to-call-twilio-functions-android" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">How to call Functions from Android</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/quickstart/how-to-call-twilio-functions-ios" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">How to call Functions from iOS</span></a></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE" data-paste-core-version="20.7.0" class="css-17onuso"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_WRAPPER" data-paste-core-version="20.7.0" class="css-1icrb9o"><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING" data-paste-core-version="20.7.0" type="button" aria-expanded="false" aria-controls=":R22lamlasm:" class="css-1vx51jp"><span data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_HEADING_EXPAND_ICON" data-paste-core-version="20.7.0" class="css-f76d15"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pft8gl"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" aria-labelledby="ChevronDisclosureIcon-:Rj9m2lamlasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M9.707 6.293a1 1 0 00-1.497 1.32l.083.094L10.585 10l-2.292 2.293a1 1 0 00-.083 1.32l.083.094a1 1 0 001.32.083l.094-.083 3-3a1 1 0 00.083-1.32l-.083-.094-3-3z"></path></svg></span></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m2bqrv">Migration guides</span></div></div><div data-paste-element="SIDEBAR_NAVIGATION_DISCLOSURE_CONTENT" data-paste-core-version="20.7.0" id=":R22lamlasm:" hidden="" style="display:none" class="css-1nm6rmy"><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions/migrating-functionsclassic-new-functions-editor" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Migrating from Functions(Classic) to the new Functions Editor</span></a><a data-paste-element="SIDEBAR_NAVIGATION_ITEM" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/node-upgrade" class="css-lafmnu"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-qxhhlx">Node.js v18 upgrade</span></a></div></div></nav></div></aside></div><style data-emotion="css 1tfs3ue">.css-1tfs3ue{box-sizing:border-box;margin-left:0;position:relative;background-color:rgb(255, 255, 255);}@media screen and (min-width: 768px){.css-1tfs3ue{margin-left:15rem;}}</style><div data-paste-element="SIDEBAR_PUSH_CONTENT_WRAPPER" data-paste-core-version="20.7.0" class="css-1tfs3ue"><style data-emotion="css 14kurmn">.css-14kurmn{box-sizing:border-box;width:100%;min-height:4.75rem;background-color:rgb(249, 249, 250);border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:rgb(225, 227, 234);padding-left:1.5rem;padding-right:1.5rem;position:-webkit-sticky;position:sticky;top:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-column-gap:1.5rem;column-gap:1.5rem;z-index:40;}</style><div data-paste-element="TOPBAR" data-paste-core-version="20.7.0" id="twilio-docs-topbar" class="css-14kurmn"><style data-emotion="css 1dkvjfb">.css-1dkvjfb{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:1rem;column-gap:1rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}@media screen and (min-width: 768px){.css-1dkvjfb{display:none;}}</style><div data-paste-element="TOPBAR_ACTIONS" data-paste-core-version="20.7.0" class="css-1dkvjfb"><style data-emotion="css 1nye0dd">.css-1nye0dd{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-width:0;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1nye0dd"><style data-emotion="css 19wcrnc">.css-19wcrnc{position:relative;-webkit-text-decoration:none;text-decoration:none;color:rgb(255, 255, 255);}.css-19wcrnc:hover{-webkit-text-decoration:underline;text-decoration:underline;}.css-19wcrnc:focus{outline:none;box-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;border-radius:2px;}</style><a class="css-19wcrnc" href="/docs"><style data-emotion="css 8jah14">.css-8jah14{box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}</style><span data-paste-element="MEDIA_OBJECT" data-paste-core-version="20.7.0" class="css-8jah14"><style data-emotion="css and4r">.css-and4r{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-right:0.75rem;}</style><span data-paste-element="MEDIA_FIGURE" data-paste-core-version="20.7.0" class="css-and4r"><style data-emotion="css jsh2a3">.css-jsh2a3{box-sizing:border-box;line-height:0;display:block;color:rgb(242, 47, 70);width:2.5rem;height:2.5rem;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}</style><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-jsh2a3"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LogoTwilioIcon-:R2da66tasm:"><title id="LogoTwilioIcon-:R2da66tasm:">Twilio Logo</title><path fill="currentColor" fill-rule="evenodd" d="M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10A10 10 0 0010 0zm0 17.333a7.333 7.333 0 110-14.666 7.333 7.333 0 010 14.666zm4.533-9.8a2.067 2.067 0 11-2.066-2.066 2.08 2.08 0 012.066 2.066zm0 4.934a2.067 2.067 0 11-2.066-2.067 2.08 2.08 0 012.066 2.067zm-4.933 0A2.067 2.067 0 117.533 10.4 2.08 2.08 0 019.6 12.467zm0-4.934a2.067 2.067 0 11-2.067-2.066A2.08 2.08 0 019.6 7.533z"></path></svg></span></span><style data-emotion="css 1i39mnm">.css-1i39mnm{box-sizing:border-box;-webkit-flex:1;-ms-flex:1;flex:1;min-width:0;}</style><span data-paste-element="MEDIA_BODY" data-paste-core-version="20.7.0" class="css-1i39mnm"><style data-emotion="css 7aad9x">.css-7aad9x{margin:0;padding:0;color:rgb(18, 28, 45);font-size:1rem;line-height:1.25rem;}</style><div data-paste-element="TEXT" data-paste-core-version="20.6.0" class="css-7aad9x">Twilio Docs</div></span></span></a></div></div><style data-emotion="css 8o6zg9">.css-8o6zg9{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:1rem;column-gap:1rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}@media screen and (min-width: 768px){.css-8o6zg9{display:none;}}</style><div data-paste-element="TOPBAR_ACTIONS" data-paste-core-version="20.7.0" class="css-8o6zg9"><style data-emotion="css miaxae">.css-miaxae{box-sizing:border-box;min-width:2.25rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-miaxae"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search" disabled=""><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div><style data-emotion="css 1b15v5e">.css-1b15v5e{box-sizing:border-box;width:auto;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;display:inline-block;border:none;outline:none;-webkit-transition:background-color 150ms ease-in,box-shadow 150ms ease-in,color 150ms ease-in;transition:background-color 150ms ease-in,box-shadow 150ms ease-in,color 150ms ease-in;font-family:inherit;font-weight:600;-webkit-text-decoration:none;text-decoration:none;position:relative;margin:0;border-radius:4px;cursor:pointer;color:rgb(18, 28, 45);background-color:rgb(255, 255, 255);box-shadow:0 0 0 1px #cacdd8;padding:0.25rem;}.css-1b15v5e:hover{background-color:rgb(255, 255, 255);box-shadow:0 0 0 1px #006dfa;color:rgb(2, 99, 224);}.css-1b15v5e:focus{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #cacdd8,0 0 0 3px #ffffff,0 0 0 4px #006dfa,0 0 0 6px #cce4ff;}.css-1b15v5e:active,.css-1b15v5e[data-active=true]{background-color:rgb(255, 255, 255);box-shadow:0 0 0 1px #06033a;color:rgb(6, 3, 58);}.css-1b15v5e:disabled,.css-1b15v5e:disabled:focus,.css-1b15v5e:disabled:hover,.css-1b15v5e[aria-disabled=true],.css-1b15v5e[aria-disabled=true]:focus,.css-1b15v5e[aria-disabled=true]:hover{background-color:rgb(255, 255, 255);box-shadow:0 0 0 1px #e1e3ea;color:rgb(174, 178, 193);}.css-1b15v5e[aria-pressed=true]{background-color:rgb(244, 249, 255);box-shadow:0 0 0 1px #006dfa;color:rgb(2, 99, 224);}.css-1b15v5e[aria-pressed=true]:hover{background-color:rgb(244, 249, 255);box-shadow:0 0 0 1px #030b5d;color:rgb(3, 11, 93);}.css-1b15v5e[aria-pressed=true]:active,.css-1b15v5e[aria-pressed=true][data-active=true]{background-color:rgb(244, 249, 255);box-shadow:0 0 0 1px #06033a;color:rgb(6, 3, 58);}.css-1b15v5e[aria-pressed=true]:focus{background-color:rgb(244, 249, 255);box-shadow:0 0 0 1px #cacdd8,0 0 0 3px #ffffff,0 0 0 4px #006dfa,0 0 0 6px #cce4ff;color:rgb(2, 99, 224);}.css-1b15v5e[aria-pressed=true]:disabled,.css-1b15v5e[aria-pressed=true][aria-disabled=true]{background-color:rgb(225, 227, 234);box-shadow:0 0 0 1px #e1e3ea;color:rgb(255, 255, 255);}</style><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="true" aria-label="Open main navigation" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><style data-emotion="css 15m1pao">.css-15m1pao{box-sizing:border-box;width:1.75rem;height:1.75rem;position:relative;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-15m1pao"><style data-emotion="css pwk8hy">.css-pwk8hy{position:absolute;width:1rem;height:3px;border-radius:8px;-webkit-transition:-webkit-transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transition:transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transform-origin:left center;background-color:rgb(96, 107, 133);top:7px;left:6px;-webkit-transform:translateX(6px) translateY(4px) rotate(45deg);-moz-transform:translateX(6px) translateY(4px) rotate(45deg);-ms-transform:translateX(6px) translateY(4px) rotate(45deg);transform:translateX(6px) translateY(4px) rotate(45deg);opacity:0;}</style><span color="colorTextIcon" transform="translateX(6px) translateY(4px) rotate(45deg)" opacity="0" class="css-pwk8hy"></span><style data-emotion="css 11r4jzp">.css-11r4jzp{position:absolute;width:1rem;height:3px;border-radius:8px;-webkit-transition:-webkit-transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transition:transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transform-origin:left center;background-color:rgb(96, 107, 133);top:13px;left:6px;-webkit-transform:translateX(2px) translateY(-5px) rotate(45deg);-moz-transform:translateX(2px) translateY(-5px) rotate(45deg);-ms-transform:translateX(2px) translateY(-5px) rotate(45deg);transform:translateX(2px) translateY(-5px) rotate(45deg);}</style><span color="colorTextIcon" transform="translateX(2px) translateY(-5px) rotate(45deg)" class="css-11r4jzp"></span><style data-emotion="css 1j6de5r">.css-1j6de5r{position:absolute;width:1rem;height:3px;border-radius:8px;-webkit-transition:-webkit-transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transition:transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transform-origin:left center;background-color:rgb(96, 107, 133);top:13px;left:6px;-webkit-transform:translateX(2px) translateY(6px) rotate(-45deg);-moz-transform:translateX(2px) translateY(6px) rotate(-45deg);-ms-transform:translateX(2px) translateY(6px) rotate(-45deg);transform:translateX(2px) translateY(6px) rotate(-45deg);}</style><span color="colorTextIcon" transform="translateX(2px) translateY(6px) rotate(-45deg)" class="css-1j6de5r"></span><style data-emotion="css 1odqdkr">.css-1odqdkr{position:absolute;width:1rem;height:3px;border-radius:8px;-webkit-transition:-webkit-transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transition:transform 0.25s ease-in-out,opacity 0.25s ease-in-out;transform-origin:left center;background-color:rgb(96, 107, 133);top:19px;left:6px;-webkit-transform:translateX(6px) translateY(-4px) rotate(-45deg);-moz-transform:translateX(6px) translateY(-4px) rotate(-45deg);-ms-transform:translateX(6px) translateY(-4px) rotate(-45deg);transform:translateX(6px) translateY(-4px) rotate(-45deg);opacity:0;}</style><span color="colorTextIcon" transform="translateX(6px) translateY(-4px) rotate(-45deg)" opacity="0" class="css-1odqdkr"></span></div></span></button></div><style data-emotion="css hemv1x">.css-hemv1x{box-sizing:border-box;display:none;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:1rem;column-gap:1rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}@media screen and (min-width: 768px){.css-hemv1x{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}@media screen and (min-width: 1024px){.css-hemv1x{display:none;}}</style><div data-paste-element="TOPBAR_ACTIONS" data-paste-core-version="20.7.0" class="css-hemv1x"><style data-emotion="css 1grha7z">.css-1grha7z{box-sizing:border-box;min-width:150px;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1grha7z"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search" disabled=""><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div><style data-emotion="css iqez3g">.css-iqez3g{box-sizing:border-box;display:none;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:1rem;column-gap:1rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}@media screen and (min-width: 768px){.css-iqez3g{display:none;}}@media screen and (min-width: 1024px){.css-iqez3g{display:none;}}@media screen and (min-width: 1385px){.css-iqez3g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}</style><div data-paste-element="TOPBAR_ACTIONS" data-paste-core-version="20.7.0" class="css-iqez3g"><style data-emotion="css dnwo4n">.css-dnwo4n{box-sizing:border-box;margin-bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;overflow:hidden;}</style><nav data-paste-element="IN_PAGE_NAVIGATION" data-paste-core-version="20.7.0" aria-label="Twilio products" class="css-dnwo4n"><style data-emotion="css ts22oj">.css-ts22oj{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}</style><style data-emotion="css 1ywodxz">.css-1ywodxz{overflow-x:auto;overflow-y:hidden;overflow-scrolling:touch;box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}@supports (-moz-appearance:none){.css-1ywodxz{padding-bottom:0px;scrollbar-width:none;}}.css-1ywodxz::-webkit-scrollbar{height:0;}.css-1ywodxz::-webkit-scrollbar-track{background:transparent;}</style><div data-paste-element="IN_PAGE_NAVIGATION_SCROLL_WRAPPER" data-paste-core-version="20.7.0" class="css-1ywodxz"><style data-emotion="css v2gylz">.css-v2gylz{box-sizing:border-box;list-style-type:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-pack:start;-ms-flex-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;padding:0;margin:0;-webkit-column-gap:1rem;column-gap:1rem;border-bottom-width:0;border-bottom-style:none;border-bottom-color:rgb(225, 227, 234);}</style><ul data-paste-element="IN_PAGE_NAVIGATION_ITEMS" data-paste-core-version="20.7.0" class="css-v2gylz"><style data-emotion="css m5glei">.css-m5glei{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;min-width:0;}</style><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><style data-emotion="css 1jrsz7z">.css-1jrsz7z{box-sizing:border-box;color:rgb(96, 107, 133);min-width:3rem;text-align:center;font-size:0.875rem;font-weight:500;overflow:hidden;position:relative;text-overflow:ellipsis;-webkit-transition:border-color 100ms ease,color 100ms ease;transition:border-color 100ms ease,color 100ms ease;white-space:nowrap;-webkit-text-decoration:none;text-decoration:none;width:100%;display:block;border-bottom-color:transparent;border-bottom-style:solid;border-bottom-width:1px;padding-bottom:0.75rem;padding-left:0.5rem;padding-right:0.5rem;padding-top:0.75rem;border-top-left-radius:8px;border-top-right-radius:8px;color:rgb(18, 28, 45);}.css-1jrsz7z:hover{border-bottom-color:rgb(3, 11, 93);border-left-color:rgb(3, 11, 93);color:rgb(3, 11, 93);}.css-1jrsz7z:focus{border-top-left-radius:8px;border-top-right-radius:8px;box-shadow:inset 0 0 0 1px #006dfa,inset 0 0 0 3px #cce4ff;outline:none;}</style><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs/messaging" class="css-1jrsz7z">Messaging</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs/voice" class="css-1jrsz7z">Voice</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless" class="css-1jrsz7z">Serverless</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs/flex" class="css-1jrsz7z">Flex</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs/studio" class="css-1jrsz7z">Studio</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs" class="css-1jrsz7z">All docs...</a></li></ul></div></nav></div><style data-emotion="css sljj2y">.css-sljj2y{box-sizing:border-box;display:none;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;-webkit-column-gap:1rem;column-gap:1rem;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}@media screen and (min-width: 768px){.css-sljj2y{display:none;}}@media screen and (min-width: 1024px){.css-sljj2y{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}</style><div data-paste-element="TOPBAR_ACTIONS" data-paste-core-version="20.7.0" class="css-sljj2y"><nav data-paste-element="IN_PAGE_NAVIGATION" data-paste-core-version="20.7.0" aria-label="Libraries and help" class="css-dnwo4n"><div data-paste-element="IN_PAGE_NAVIGATION_SCROLL_WRAPPER" data-paste-core-version="20.7.0" class="css-1ywodxz"><ul data-paste-element="IN_PAGE_NAVIGATION_ITEMS" data-paste-core-version="20.7.0" class="css-v2gylz"><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" href="/docs/libraries" class="css-1jrsz7z">SDKs</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" rel="noreferrer noopener" target="_blank" href="https://help.twilio.com" class="css-1jrsz7z"><style data-emotion="css sncxrr">.css-sncxrr{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-sncxrr">Help<span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LinkExternalIcon-:Ralal6m6tasm:"><title id="LinkExternalIcon-:Ralal6m6tasm:">Help</title><path fill="currentColor" fill-rule="evenodd" d="M8.4 4.5a.5.5 0 01.5.5v.1a.5.5 0 01-.5.5H5.6v8.8h8.8v-2.8a.5.5 0 01.41-.492l.09-.008h.1a.5.5 0 01.492.41l.008.09V15a.5.5 0 01-.41.492L15 15.5H5a.5.5 0 01-.492-.41L4.5 15V5a.5.5 0 01.41-.492L5 4.5h3.4zm6.6 0a.5.5 0 01.5.5v.1l-.001.01.001 3.29a.5.5 0 01-.5.5h-.1a.5.5 0 01-.5-.5l-.001-1.935-3.967 3.967a.611.611 0 01-.78.07l-.084-.07a.611.611 0 01-.07-.78l.07-.084L13.534 5.6H11.6a.5.5 0 01-.5-.5V5a.5.5 0 01.5-.5H15z"></path></svg></span></div></a></li></ul></div></nav><style data-emotion="css inbhe0">.css-inbhe0{box-sizing:border-box;margin-left:1rem;margin-right:1rem;min-width:12rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-inbhe0"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search" disabled=""><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div><nav data-paste-element="IN_PAGE_NAVIGATION" data-paste-core-version="20.7.0" aria-label="Log in or sign up" class="css-dnwo4n"><div data-paste-element="IN_PAGE_NAVIGATION_SCROLL_WRAPPER" data-paste-core-version="20.7.0" class="css-1ywodxz"><ul data-paste-element="IN_PAGE_NAVIGATION_ITEMS" data-paste-core-version="20.7.0" class="css-v2gylz"><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" rel="noreferrer noopener" target="_blank" href="https://www.twilio.com/login" class="css-1jrsz7z">Log in</a></li><li data-paste-element="TOPBAR_NAV_ITEM" data-paste-core-version="20.7.0" class="css-m5glei"><a data-paste-element="TOPBAR_NAV_ITEM_ANCHOR" data-paste-core-version="20.7.0" rel="noreferrer noopener" target="_blank" href="https://www.twilio.com/try-twilio" class="css-1jrsz7z">Sign up</a></li></ul></div></nav></div></div><style data-emotion="css m2wd1f">.css-m2wd1f{box-sizing:border-box;padding-top:5.75rem;padding-left:1.5rem;padding-right:1.5rem;background-color:rgb(255, 255, 255);position:relative;margin-left:auto;margin-right:auto;max-width:77rem;box-sizing:content-box;}@media screen and (min-width: 768px){.css-m2wd1f{padding-top:5.75rem;padding-left:1.5rem;padding-right:1.5rem;}}@media screen and (min-width: 1024px){.css-m2wd1f{padding-top:5.75rem;padding-left:3.25rem;padding-right:3.25rem;}}@media screen and (min-width: 1385px){.css-m2wd1f{padding-top:2.25rem;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" id="twilio-docs-content-area" class="css-m2wd1f"><style data-emotion="css 146sg2s">.css-146sg2s{box-sizing:border-box;display:block;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}@media screen and (min-width: 768px){.css-146sg2s{display:block;}}@media screen and (min-width: 1024px){.css-146sg2s{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-146sg2s"><style data-emotion="css 1jcpq9j">.css-1jcpq9j{box-sizing:border-box;display:none;-webkit-order:2;-ms-flex-order:2;order:2;margin-left:4.25rem;width:18.5rem;}@media screen and (min-width: 768px){.css-1jcpq9j{display:none;}}@media screen and (min-width: 1024px){.css-1jcpq9j{display:none;}}@media screen and (min-width: 1385px){.css-1jcpq9j{display:block;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" id="twilio-docs-content-aside-area" class="css-1jcpq9j"><style data-emotion="css 5v6lp">.css-5v6lp{box-sizing:border-box;position:-webkit-sticky;position:sticky;top:100px;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-5v6lp"><style data-emotion="css 1j4yy0t">.css-1j4yy0t{box-sizing:border-box;max-height:calc(100vh - 76px - 24px - 9rem);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1j4yy0t"><style data-emotion="css 1vgbamy">.css-1vgbamy{margin:0;padding:0;color:rgb(18, 28, 45);font-size:0.875rem;line-height:1.25rem;margin-bottom:0.5rem;font-weight:600;letter-spacing:-.02em;display:block;}</style><span data-paste-element="HEADING" data-paste-core-version="20.6.0" class="css-1vgbamy">On this page</span><style data-emotion="css zs6taj">.css-zs6taj{box-sizing:border-box;overflow:auto;margin-bottom:1.75rem;-webkit-flex:auto;-ms-flex:auto;flex:auto;}</style><nav data-paste-element="BOX" data-paste-core-version="20.7.0" aria-label="document outline" class="css-zs6taj"><style data-emotion="css 15sthfg">.css-15sthfg{margin:0;padding:0;list-style:none;border-left-width:1px;border-left-style:solid;border-left-color:rgb(202, 205, 216);}</style><ul class="css-15sthfg"><style data-emotion="css 7tz84n">.css-7tz84n{display:block;margin-top:1rem;font-size:0.875rem;line-height:1.5rem;border-radius:2px;}.css-7tz84n.is-current{font-weight:600;}.css-7tz84n.is-current a{color:rgb(2, 99, 224);border-color:rgb(0, 109, 250);}.css-7tz84n:focus-within{box-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;}</style><li class="is-current css-7tz84n"><style data-emotion="css yczov4">.css-yczov4{box-sizing:border-box;padding-left:2rem;color:rgb(96, 107, 133);-webkit-text-decoration:none;text-decoration:none;display:inline-block;width:100%;border-left-color:transparent;border-left-style:solid;border-left-width:2px;}.css-yczov4:focus{outline:none;border-left-color:rgb(3, 11, 93);color:rgb(3, 11, 93);}.css-yczov4:hover{border-left-color:rgb(3, 11, 93);color:rgb(3, 11, 93);}</style><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#methods" class="css-yczov4">Methods</a></li><style data-emotion="css 4ao0a4">.css-4ao0a4{display:block;margin-top:0.5rem;font-size:0.75rem;line-height:1.25rem;border-radius:2px;}.css-4ao0a4.is-current{font-weight:600;}.css-4ao0a4.is-current a{color:rgb(2, 99, 224);border-color:rgb(0, 109, 250);}.css-4ao0a4:focus-within{box-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;}</style><li class=" css-4ao0a4"><style data-emotion="css bc5avt">.css-bc5avt{box-sizing:border-box;padding-left:3.25rem;color:rgb(96, 107, 133);-webkit-text-decoration:none;text-decoration:none;display:inline-block;width:100%;border-left-color:transparent;border-left-style:solid;border-left-width:2px;}.css-bc5avt:focus{outline:none;border-left-color:rgb(3, 11, 93);color:rgb(3, 11, 93);}.css-bc5avt:hover{border-left-color:rgb(3, 11, 93);color:rgb(3, 11, 93);}</style><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#getassets" class="css-bc5avt">getAssets()</a></li><li class=" css-4ao0a4"><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#getfunctions" class="css-bc5avt">getFunctions()</a></li><li class=" css-4ao0a4"><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#getsyncoptions" class="css-bc5avt">getSync(options?)</a></li></ul></nav></div></div></div><style data-emotion="css 1gmyo3z">.css-1gmyo3z{position:relative;min-width:0;width:100%;word-wrap:break-word;max-width:57.5rem;}.css-1gmyo3z div+hr+section>hr{display:none;}.css-1gmyo3z div+hr+style+section>hr{display:none;}.css-1gmyo3z div+hr+hr{display:none;}</style><style data-emotion="css ykb4uo">.css-ykb4uo{box-sizing:border-box;position:relative;min-width:0;width:100%;word-wrap:break-word;max-width:57.5rem;}.css-ykb4uo div+hr+section>hr{display:none;}.css-ykb4uo div+hr+style+section>hr{display:none;}.css-ykb4uo div+hr+hr{display:none;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ykb4uo"><style data-emotion="css 2g10on">.css-2g10on{box-sizing:border-box;display:block;}@media screen and (min-width: 768px){.css-2g10on{display:block;}}@media screen and (min-width: 1024px){.css-2g10on{display:block;}}@media screen and (min-width: 1385px){.css-2g10on{display:none;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-2g10on"><style data-emotion="css 6yc7tt">.css-6yc7tt{box-sizing:border-box;display:block;position:fixed;top:76px;margin-left:-1.5rem;margin-right:-1.5rem;padding-left:1.5rem;padding-top:1.5rem;padding-bottom:1.5rem;background-color:rgb(255, 255, 255);width:-webkit-fill-available;width:-moz-available;width:fill-available;z-index:20;}</style><nav data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-6yc7tt"><style data-emotion="css zv9zrj">.css-zv9zrj{box-sizing:border-box;width:auto;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;display:inline-block;border:none;outline:none;-webkit-transition:background-color 100ms ease-in,box-shadow 100ms ease-in,color 100ms ease-in;transition:background-color 100ms ease-in,box-shadow 100ms ease-in,color 100ms ease-in;font-family:inherit;font-weight:600;-webkit-text-decoration:none;text-decoration:none;position:relative;margin:0;border-radius:4px;cursor:pointer;color:rgb(18, 28, 45);background-color:rgb(255, 255, 255);box-shadow:0 0 0 1px #cacdd8;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:0.875rem;line-height:1.25rem;}.css-zv9zrj:hover{-webkit-text-decoration:none;text-decoration:none;color:rgb(2, 99, 224);background-color:rgb(255, 255, 255);box-shadow:0 0 0 1px #006dfa;}.css-zv9zrj:focus{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #cacdd8,0 0 0 3px #ffffff,0 0 0 4px #006dfa,0 0 0 6px #cce4ff;}.css-zv9zrj:active,.css-zv9zrj[data-active=true]{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #001489;color:rgb(0, 20, 137);background-color:rgb(244, 249, 255);}</style><button data-paste-element="MENU_BUTTON" data-paste-core-version="20.7.0" type="button" aria-expanded="false" aria-controls=":Rhlaatasm:" aria-haspopup="menu" aria-busy="false" class="css-zv9zrj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j">On this page<span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="ChevronDownIcon-:R56dhlaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M6.293 8.293a1 1 0 011.32-.083l.094.083L10 10.585l2.293-2.292a1 1 0 011.32-.083l.094.083a1 1 0 01.083 1.32l-.083.094-3 3a1 1 0 01-1.32.083l-.094-.083-3-3a1 1 0 010-1.414z"></path></svg></span></span></button><style data-emotion="css 31h1qt">.css-31h1qt{box-sizing:border-box;background-color:rgb(255, 255, 255);border-style:solid;border-width:1px;border-color:rgb(225, 227, 234);border-radius:8px;box-shadow:0 4px 16px 0 rgba(18, 28, 45, 0.2);max-width:18.5rem;min-width:12rem;z-index:20;padding-top:0.5rem;padding-bottom:0.5rem;overflow-y:scroll;max-height:18.5rem;}.css-31h1qt:focus{outline:none;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" id=":Rhlaatasm:" hidden="" style="display:none;position:fixed;left:100%;top:100%" role="menu" tabindex="-1" data-dialog="true" aria-orientation="vertical" aria-label="document outline" class="css-31h1qt"><style data-emotion="css oa1jzu">.css-oa1jzu{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;border:none;display:block;text-align:left;font-family:inherit;font-size:0.875rem;font-weight:400;line-height:1.25rem;margin:0;outline:none;padding-top:0.5rem;padding-bottom:0.5rem;border-left-style:solid;border-left-width:2px;border-color:transparent;cursor:pointer;padding-left:1.5rem;padding-right:1.5rem;width:100%;color:rgb(18, 28, 45);-webkit-text-decoration:none;text-decoration:none;color:rgb(2, 99, 224);background-color:rgb(244, 249, 255);border-color:rgb(0, 109, 250);}.css-oa1jzu:hover{color:rgb(2, 99, 224);background-color:rgb(244, 249, 255);border-color:rgb(0, 109, 250);}.css-oa1jzu:focus{color:rgb(2, 99, 224);background-color:rgb(244, 249, 255);border-color:rgb(0, 109, 250);}.css-oa1jzu:disabled,.css-oa1jzu:disabled:focus,.css-oa1jzu:disabled:hover,.css-oa1jzu[aria-disabled=true],.css-oa1jzu[aria-disabled=true]:focus,.css-oa1jzu[aria-disabled=true]:hover{color:rgb(174, 178, 193);cursor:not-allowed;background-color:rgb(255, 255, 255);border-color:transparent;}</style><a data-paste-element="MOBILE_TOC_MENU_LINK_ACTIVE" data-paste-core-version="20.7.0" href="#methods" id=":Rhlaatasm:-1" role="menuitem" class="css-oa1jzu"><style data-emotion="css roynbj">.css-roynbj{box-sizing:border-box;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj">Methods</div></a><style data-emotion="css rrw0kl">.css-rrw0kl{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;border:none;display:block;text-align:left;font-family:inherit;font-size:0.875rem;font-weight:400;line-height:1.25rem;margin:0;outline:none;padding-top:0.5rem;padding-bottom:0.5rem;border-left-style:solid;border-left-width:2px;border-color:transparent;cursor:pointer;padding-left:1.5rem;padding-right:1.5rem;width:100%;color:rgb(18, 28, 45);-webkit-text-decoration:none;text-decoration:none;}.css-rrw0kl:hover{color:rgb(2, 99, 224);background-color:rgb(244, 249, 255);border-color:rgb(0, 109, 250);}.css-rrw0kl:focus{color:rgb(2, 99, 224);background-color:rgb(244, 249, 255);border-color:rgb(0, 109, 250);}.css-rrw0kl:disabled,.css-rrw0kl:disabled:focus,.css-rrw0kl:disabled:hover,.css-rrw0kl[aria-disabled=true],.css-rrw0kl[aria-disabled=true]:focus,.css-rrw0kl[aria-disabled=true]:hover{color:rgb(174, 178, 193);cursor:not-allowed;background-color:rgb(255, 255, 255);border-color:transparent;}</style><a data-paste-element="MOBILE_TOC_MENU_LINK" data-paste-core-version="20.7.0" href="#getassets" id=":Rhlaatasm:-2" role="menuitem" class="css-rrw0kl"><style data-emotion="css kyczyy">.css-kyczyy{box-sizing:border-box;padding-left:1.25rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-kyczyy">getAssets()</div></a><a data-paste-element="MOBILE_TOC_MENU_LINK" data-paste-core-version="20.7.0" href="#getfunctions" id=":Rhlaatasm:-3" role="menuitem" class="css-rrw0kl"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-kyczyy">getFunctions()</div></a><a data-paste-element="MOBILE_TOC_MENU_LINK" data-paste-core-version="20.7.0" href="#getsyncoptions" id=":Rhlaatasm:-4" role="menuitem" class="css-rrw0kl"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-kyczyy">getSync(options?)</div></a></div></nav></div><style data-emotion="css m8ey6p">.css-m8ey6p{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-align-items:baseline;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;-webkit-column-gap:0.75rem;column-gap:0.75rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-m8ey6p"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css 10br7e4">.css-10br7e4{margin:0;padding:0;color:rgb(18, 28, 45);font-size:2rem;line-height:2.5rem;margin-bottom:0;font-weight:600;letter-spacing:-.02em;display:block;}</style><h1 data-paste-element="HEADING" data-paste-core-version="20.6.0" class="css-10br7e4">Runtime Client</h1></div><style data-emotion="css 7lkj4y">section:focus-within .css-7lkj4y,section:hover .css-7lkj4y{opacity:1;}</style><style data-emotion="css 136zex2">.css-136zex2{box-sizing:border-box;opacity:1;-webkit-transition:opacity 0.25s ease-in-out;transition:opacity 0.25s ease-in-out;}section:focus-within .css-136zex2,section:hover .css-136zex2{opacity:1;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-136zex2"><style data-emotion="css knmi57">.css-knmi57{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-column-gap:0.75rem;column-gap:0.75rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-knmi57"><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsUpIcon-:R2cqlaalaatasm:"><title id="ThumbsUpIcon-:R2cqlaalaatasm:">Positive Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M6.5 7.45c.194-.216.406-.451.628-.707.799-.922 1.608-1.972 1.898-2.838.314-.938 1.139-1.487 1.966-1.395a1.57 1.57 0 011.085.621c.277.363.423.85.423 1.43 0 .327-.081.645-.174.924-.062.186-.139.383-.208.56l-.088.226c-.092.245-.15.432-.166.582-.014.134.01.19.033.222l.001.001a.415.415 0 00.1.058 1.9 1.9 0 00.371.11c.32.068.725.106 1.152.124.632.026 1.237.01 1.634-.002.147-.004.265-.008.345-.008.25 0 .731.008 1.158.218.224.11.443.28.603.537.159.256.239.567.239.924 0 1.218-.524 3.647-1.553 5.695-.31.616-.693.885-1.18 1.193-.574.364-1.145.575-1.767.575h-3c-1.116 0-2.204-.418-3.002-.883a6.393 6.393 0 01-.498-.322v.372a.5.5 0 01-.5.5H3a.5.5 0 01-.5-.5V7a.5.5 0 01.5-.5h3a.5.5 0 01.5.5v.45zm3.474-3.228c.186-.554.611-.751.909-.718a.57.57 0 01.399.233c.114.15.218.409.218.824 0 .17-.044.37-.123.61a9.287 9.287 0 01-.177.474c-.034.087-.07.177-.105.273-.095.252-.194.542-.225.827-.032.297.005.636.23.935.135.178.322.291.491.367.175.078.372.134.571.176.4.084.869.125 1.317.144.676.028 1.382.008 1.767-.003.118-.003.206-.006.254-.006.25 0 .519.018.717.115.088.044.15.098.194.168.044.07.089.19.089.396 0 1.04-.476 3.316-1.447 5.246-.184.367-.375.516-.82.797-.468.296-.855.42-1.233.42h-3c-.884 0-1.796-.338-2.498-.747a4.464 4.464 0 01-.813-.591 1.36 1.36 0 01-.184-.207l-.005-.008V8.968a7.331 7.331 0 01.329-.39l.308-.343c.223-.246.483-.534.746-.837.788-.909 1.73-2.097 2.091-3.176zM5.5 7.5h-2v7.667h2V7.5z"></path></svg></span></span></button><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsDownIcon-:R2dalaalaatasm:"><title id="ThumbsDownIcon-:R2dalaalaatasm:">Negative Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M13.5 12.55c-.194.215-.406.451-.628.707-.799.921-1.608 1.972-1.898 2.838-.314.938-1.139 1.487-1.966 1.395a1.57 1.57 0 01-1.085-.621c-.277-.363-.423-.85-.423-1.43 0-.327.081-.645.174-.924.062-.186.139-.383.208-.56l.088-.226c.092-.245.15-.432.166-.582.014-.134-.01-.19-.033-.222l-.001-.001a.416.416 0 00-.1-.058 1.902 1.902 0 00-.371-.11 7.35 7.35 0 00-1.152-.124 22.958 22.958 0 00-1.634.002 14.2 14.2 0 01-.345.008c-.25 0-.731-.008-1.158-.218a1.451 1.451 0 01-.603-.537c-.159-.257-.239-.567-.239-.924 0-1.218.524-3.648 1.553-5.696.31-.616.693-.884 1.18-1.192C5.807 3.71 6.378 3.5 7 3.5h3c1.116 0 2.204.417 3.002.883.178.104.345.212.498.321v-.37a.5.5 0 01.5-.5h3a.5.5 0 01.5.5V13a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5v-.45zm-3.474 3.227c-.186.554-.611.752-.909.72a.571.571 0 01-.399-.234c-.114-.15-.218-.409-.218-.824a2 2 0 01.123-.61c.054-.16.113-.312.177-.475.034-.086.07-.176.105-.272.095-.252.194-.542.225-.828.032-.296-.005-.635-.23-.934a1.23 1.23 0 00-.491-.367 2.874 2.874 0 00-.571-.176 8.31 8.31 0 00-1.317-.144c-.676-.029-1.381-.008-1.767.003-.118.003-.206.006-.254.006-.25 0-.519-.018-.717-.115a.452.452 0 01-.194-.168c-.044-.07-.089-.19-.089-.396 0-1.04.476-3.316 1.447-5.247.184-.366.375-.515.82-.796.468-.296.855-.42 1.233-.42h3c.884 0 1.796.337 2.498.747.349.203.628.414.813.59.093.09.152.16.184.208l.005.007v4.98a7.245 7.245 0 01-.329.39 54.1 54.1 0 01-.308.342c-.223.247-.483.534-.746.838-.788.909-1.73 2.096-2.091 3.175zM14.5 12.5h2V4.833h-2V12.5z"></path></svg></span></span></button></div></div></div><style data-emotion="css 1y5brhz">.css-1y5brhz{box-sizing:border-box;margin:0;margin-bottom:2.25rem;margin-top:2.25rem;border-width:0;border-color:rgb(225, 227, 234);border-style:solid;border-bottom-width:1px;width:auto;}</style><hr data-paste-element="SEPARATOR" data-paste-core-version="20.7.0" aria-orientation="horizontal" class="css-1y5brhz"/><style data-emotion="css tcah8o">.css-tcah8o{margin:0;padding:0;color:rgb(18, 28, 45);font-size:0.875rem;line-height:1.5rem;font-weight:400;margin-bottom:1.5rem;}</style><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">The Twilio <strong>Runtime Client</strong> provides a direct way of orchestrating the various parts of the Twilio Runtime without requiring an imported module. Using the Runtime Client, developers can reference other <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/functions" title="Functions" class="css-lpeit6">Functions</a> to better organize their code, access configuration and files stored in <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/assets" title="Assets" class="css-lpeit6">Assets</a>, and manage real-time data via <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/sync" title="Twilio Sync" class="css-lpeit6">Twilio Sync</a>.</p> <p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Access the Runtime Client in a Function by referencing <style data-emotion="css 1kwd7zr">.css-1kwd7zr{box-sizing:border-box;border-width:1px;border-style:solid;border-radius:4px;font-family:'TwilioSansMono',Courier,monospace;font-size:inherit;line-height:inherit;padding-left:0.25rem;padding-right:0.25rem;color:inherit;background-color:rgb(249, 249, 250);border-color:rgb(202, 205, 216);}</style><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime</code>, which exposes the following API:</p> <style data-emotion="css 1bt452l">.css-1bt452l{margin:0;padding:0;color:rgb(18, 28, 45);font-size:0.875rem;line-height:1.5rem;margin-bottom:1.5rem;font-weight:400;margin-left:1.5rem;list-style-type:disc;}</style><ul data-paste-element="UNORDERED_LIST" data-paste-core-version="20.6.0" class="css-1bt452l"> <style data-emotion="css 1pp5a8v">.css-1pp5a8v{margin:0;padding:0;color:rgb(18, 28, 45);font-size:0.875rem;line-height:1.5rem;font-weight:400;margin-bottom:0.5rem;margin-top:0.5rem;}</style><li data-paste-element="LIST_ITEM" data-paste-core-version="20.6.0" class="css-1pp5a8v"><a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/client#methods" title="Methods" class="css-lpeit6">Methods</a> <ul data-paste-element="UNORDERED_LIST" data-paste-core-version="20.6.0" class="css-1bt452l"> <li data-paste-element="LIST_ITEM" data-paste-core-version="20.6.0" class="css-1pp5a8v"><a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/client#getassets" title="getAssets()" class="css-lpeit6">getAssets()</a></li> <li data-paste-element="LIST_ITEM" data-paste-core-version="20.6.0" class="css-1pp5a8v"><a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/client#getfunctions" title="getFunction()" class="css-lpeit6">getFunction()</a></li> <li data-paste-element="LIST_ITEM" data-paste-core-version="20.6.0" class="css-1pp5a8v"><a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/client#getsyncoptions" title="getSync()" class="css-lpeit6">getSync()</a></li> </ul> </li> </ul> <section id="methods-section-indexable"><hr data-paste-element="SEPARATOR" data-paste-core-version="20.7.0" aria-orientation="horizontal" class="css-1y5brhz"/><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-m8ey6p"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css gt12nx">.css-gt12nx{box-sizing:border-box;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;margin-bottom:1.25rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-gt12nx"><style data-emotion="css 16k5vxt">.css-16k5vxt{margin:0;padding:0;color:rgb(18, 28, 45);font-size:1.5rem;line-height:2rem;margin-bottom:0;font-weight:600;letter-spacing:-.02em;display:inline;}</style><h2 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="methods" class="css-16k5vxt">Methods</h2><style data-emotion="css f02h4i">.css-f02h4i{box-sizing:border-box;margin-bottom:0;-webkit-text-decoration:none;text-decoration:none;margin-left:0.5rem;color:rgb(96, 107, 133);border-radius:2px;outline:none;display:inline-block;vertical-align:text-bottom;}.css-f02h4i:hover{color:rgb(3, 11, 93);}.css-f02h4i:focus{box-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;color:rgb(3, 11, 93);}</style><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#methods" class="css-f02h4i"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R5ad1slaatasm:"><title id="LinkIcon-:R5ad1slaatasm:">methods page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div></div><style data-emotion="css 1kam78h">.css-1kam78h{box-sizing:border-box;opacity:0;-webkit-transition:opacity 0.25s ease-in-out;transition:opacity 0.25s ease-in-out;}section:focus-within .css-1kam78h,section:hover .css-1kam78h{opacity:1;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1kam78h"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-knmi57"><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsUpIcon-:R16dal1slaatasm:"><title id="ThumbsUpIcon-:R16dal1slaatasm:">Positive Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M6.5 7.45c.194-.216.406-.451.628-.707.799-.922 1.608-1.972 1.898-2.838.314-.938 1.139-1.487 1.966-1.395a1.57 1.57 0 011.085.621c.277.363.423.85.423 1.43 0 .327-.081.645-.174.924-.062.186-.139.383-.208.56l-.088.226c-.092.245-.15.432-.166.582-.014.134.01.19.033.222l.001.001a.415.415 0 00.1.058 1.9 1.9 0 00.371.11c.32.068.725.106 1.152.124.632.026 1.237.01 1.634-.002.147-.004.265-.008.345-.008.25 0 .731.008 1.158.218.224.11.443.28.603.537.159.256.239.567.239.924 0 1.218-.524 3.647-1.553 5.695-.31.616-.693.885-1.18 1.193-.574.364-1.145.575-1.767.575h-3c-1.116 0-2.204-.418-3.002-.883a6.393 6.393 0 01-.498-.322v.372a.5.5 0 01-.5.5H3a.5.5 0 01-.5-.5V7a.5.5 0 01.5-.5h3a.5.5 0 01.5.5v.45zm3.474-3.228c.186-.554.611-.751.909-.718a.57.57 0 01.399.233c.114.15.218.409.218.824 0 .17-.044.37-.123.61a9.287 9.287 0 01-.177.474c-.034.087-.07.177-.105.273-.095.252-.194.542-.225.827-.032.297.005.636.23.935.135.178.322.291.491.367.175.078.372.134.571.176.4.084.869.125 1.317.144.676.028 1.382.008 1.767-.003.118-.003.206-.006.254-.006.25 0 .519.018.717.115.088.044.15.098.194.168.044.07.089.19.089.396 0 1.04-.476 3.316-1.447 5.246-.184.367-.375.516-.82.797-.468.296-.855.42-1.233.42h-3c-.884 0-1.796-.338-2.498-.747a4.464 4.464 0 01-.813-.591 1.36 1.36 0 01-.184-.207l-.005-.008V8.968a7.331 7.331 0 01.329-.39l.308-.343c.223-.246.483-.534.746-.837.788-.909 1.73-2.097 2.091-3.176zM5.5 7.5h-2v7.667h2V7.5z"></path></svg></span></span></button><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsDownIcon-:R16lal1slaatasm:"><title id="ThumbsDownIcon-:R16lal1slaatasm:">Negative Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M13.5 12.55c-.194.215-.406.451-.628.707-.799.921-1.608 1.972-1.898 2.838-.314.938-1.139 1.487-1.966 1.395a1.57 1.57 0 01-1.085-.621c-.277-.363-.423-.85-.423-1.43 0-.327.081-.645.174-.924.062-.186.139-.383.208-.56l.088-.226c.092-.245.15-.432.166-.582.014-.134-.01-.19-.033-.222l-.001-.001a.416.416 0 00-.1-.058 1.902 1.902 0 00-.371-.11 7.35 7.35 0 00-1.152-.124 22.958 22.958 0 00-1.634.002 14.2 14.2 0 01-.345.008c-.25 0-.731-.008-1.158-.218a1.451 1.451 0 01-.603-.537c-.159-.257-.239-.567-.239-.924 0-1.218.524-3.648 1.553-5.696.31-.616.693-.884 1.18-1.192C5.807 3.71 6.378 3.5 7 3.5h3c1.116 0 2.204.417 3.002.883.178.104.345.212.498.321v-.37a.5.5 0 01.5-.5h3a.5.5 0 01.5.5V13a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5v-.45zm-3.474 3.227c-.186.554-.611.752-.909.72a.571.571 0 01-.399-.234c-.114-.15-.218-.409-.218-.824a2 2 0 01.123-.61c.054-.16.113-.312.177-.475.034-.086.07-.176.105-.272.095-.252.194-.542.225-.828.032-.296-.005-.635-.23-.934a1.23 1.23 0 00-.491-.367 2.874 2.874 0 00-.571-.176 8.31 8.31 0 00-1.317-.144c-.676-.029-1.381-.008-1.767.003-.118.003-.206.006-.254.006-.25 0-.519-.018-.717-.115a.452.452 0 01-.194-.168c-.044-.07-.089-.19-.089-.396 0-1.04.476-3.316 1.447-5.247.184-.366.375-.515.82-.796.468-.296.855-.42 1.233-.42h3c.884 0 1.796.337 2.498.747.349.203.628.414.813.59.093.09.152.16.184.208l.005.007v4.98a7.245 7.245 0 01-.329.39 54.1 54.1 0 01-.308.342c-.223.247-.483.534-.746.838-.788.909-1.73 2.096-2.091 3.175zM14.5 12.5h2V4.833h-2V12.5z"></path></svg></span></span></button></div></div></div></section> <section id="getassets-section-indexable"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-m8ey6p"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css a8lapc">.css-a8lapc{box-sizing:border-box;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;margin-bottom:1rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-a8lapc"><style data-emotion="css yftbgj">.css-yftbgj{margin:0;padding:0;color:rgb(18, 28, 45);font-size:1.25rem;line-height:1.75rem;margin-bottom:0;font-weight:600;letter-spacing:-.02em;display:inline;}</style><h3 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="getassets" class="css-yftbgj"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getAssets()</code></h3><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#getassets" class="css-f02h4i"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R1aj8iclaatasm:"><title id="LinkIcon-:R1aj8iclaatasm:">getassets page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1kam78h"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-knmi57"><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsUpIcon-:R9jal8iclaatasm:"><title id="ThumbsUpIcon-:R9jal8iclaatasm:">Positive Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M6.5 7.45c.194-.216.406-.451.628-.707.799-.922 1.608-1.972 1.898-2.838.314-.938 1.139-1.487 1.966-1.395a1.57 1.57 0 011.085.621c.277.363.423.85.423 1.43 0 .327-.081.645-.174.924-.062.186-.139.383-.208.56l-.088.226c-.092.245-.15.432-.166.582-.014.134.01.19.033.222l.001.001a.415.415 0 00.1.058 1.9 1.9 0 00.371.11c.32.068.725.106 1.152.124.632.026 1.237.01 1.634-.002.147-.004.265-.008.345-.008.25 0 .731.008 1.158.218.224.11.443.28.603.537.159.256.239.567.239.924 0 1.218-.524 3.647-1.553 5.695-.31.616-.693.885-1.18 1.193-.574.364-1.145.575-1.767.575h-3c-1.116 0-2.204-.418-3.002-.883a6.393 6.393 0 01-.498-.322v.372a.5.5 0 01-.5.5H3a.5.5 0 01-.5-.5V7a.5.5 0 01.5-.5h3a.5.5 0 01.5.5v.45zm3.474-3.228c.186-.554.611-.751.909-.718a.57.57 0 01.399.233c.114.15.218.409.218.824 0 .17-.044.37-.123.61a9.287 9.287 0 01-.177.474c-.034.087-.07.177-.105.273-.095.252-.194.542-.225.827-.032.297.005.636.23.935.135.178.322.291.491.367.175.078.372.134.571.176.4.084.869.125 1.317.144.676.028 1.382.008 1.767-.003.118-.003.206-.006.254-.006.25 0 .519.018.717.115.088.044.15.098.194.168.044.07.089.19.089.396 0 1.04-.476 3.316-1.447 5.246-.184.367-.375.516-.82.797-.468.296-.855.42-1.233.42h-3c-.884 0-1.796-.338-2.498-.747a4.464 4.464 0 01-.813-.591 1.36 1.36 0 01-.184-.207l-.005-.008V8.968a7.331 7.331 0 01.329-.39l.308-.343c.223-.246.483-.534.746-.837.788-.909 1.73-2.097 2.091-3.176zM5.5 7.5h-2v7.667h2V7.5z"></path></svg></span></span></button><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsDownIcon-:R9lal8iclaatasm:"><title id="ThumbsDownIcon-:R9lal8iclaatasm:">Negative Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M13.5 12.55c-.194.215-.406.451-.628.707-.799.921-1.608 1.972-1.898 2.838-.314.938-1.139 1.487-1.966 1.395a1.57 1.57 0 01-1.085-.621c-.277-.363-.423-.85-.423-1.43 0-.327.081-.645.174-.924.062-.186.139-.383.208-.56l.088-.226c.092-.245.15-.432.166-.582.014-.134-.01-.19-.033-.222l-.001-.001a.416.416 0 00-.1-.058 1.902 1.902 0 00-.371-.11 7.35 7.35 0 00-1.152-.124 22.958 22.958 0 00-1.634.002 14.2 14.2 0 01-.345.008c-.25 0-.731-.008-1.158-.218a1.451 1.451 0 01-.603-.537c-.159-.257-.239-.567-.239-.924 0-1.218.524-3.648 1.553-5.696.31-.616.693-.884 1.18-1.192C5.807 3.71 6.378 3.5 7 3.5h3c1.116 0 2.204.417 3.002.883.178.104.345.212.498.321v-.37a.5.5 0 01.5-.5h3a.5.5 0 01.5.5V13a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5v-.45zm-3.474 3.227c-.186.554-.611.752-.909.72a.571.571 0 01-.399-.234c-.114-.15-.218-.409-.218-.824a2 2 0 01.123-.61c.054-.16.113-.312.177-.475.034-.086.07-.176.105-.272.095-.252.194-.542.225-.828.032-.296-.005-.635-.23-.934a1.23 1.23 0 00-.491-.367 2.874 2.874 0 00-.571-.176 8.31 8.31 0 00-1.317-.144c-.676-.029-1.381-.008-1.767.003-.118.003-.206.006-.254.006-.25 0-.519-.018-.717-.115a.452.452 0 01-.194-.168c-.044-.07-.089-.19-.089-.396 0-1.04.476-3.316 1.447-5.247.184-.366.375-.515.82-.796.468-.296.855-.42 1.233-.42h3c.884 0 1.796.337 2.498.747.349.203.628.414.813.59.093.09.152.16.184.208l.005.007v4.98a7.245 7.245 0 01-.329.39 54.1 54.1 0 01-.308.342c-.223.247-.483.534-.746.838-.788.909-1.73 2.096-2.091 3.175zM14.5 12.5h2V4.833h-2V12.5z"></path></svg></span></span></button></div></div></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">The <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getAssets</code> method returns an object that contains the names each <strong>private</strong> Asset in a Service. Each Asset name serves as the key to an Asset object that contains the <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">path</code> to that Asset, as well as an <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">open</code> method that can be conveniently used to access its contents. These paths can be used to retrieve files served on <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/assets" title="Twilio Assets" class="css-lpeit6">Twilio Assets</a>.</p><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">For example, executing <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getAssets()</code> could return an object with the following private Assets:</p><style data-emotion="css slcqjs">.css-slcqjs{box-sizing:border-box;margin-bottom:1.5rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><style data-emotion="css 1ft5k6i">.css-1ft5k6i{box-sizing:border-box;background-color:rgb(31, 48, 76);border-radius:4px;overflow:hidden;}</style><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><style data-emotion="css 1lrte93">.css-1lrte93{box-sizing:border-box;background-color:rgb(18, 28, 45);display:grid;grid-template-rows:auto 1fr;grid-template-areas:"button-group" "code-block";row-gap:0.25rem;padding-top:1rem;}</style><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><style data-emotion="css ba3ttd">.css-ba3ttd{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-column-gap:0.75rem;column-gap:0.75rem;-webkit-box-pack:end;-ms-flex-pack:end;-webkit-justify-content:flex-end;justify-content:flex-end;grid-area:button-group;padding-right:1.5rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css 11aawc9">.css-11aawc9{box-sizing:border-box;width:auto;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:none;display:inline-block;border:none;outline:none;-webkit-transition:background-color 100ms ease-in,box-shadow 100ms ease-in,color 100ms ease-in;transition:background-color 100ms ease-in,box-shadow 100ms ease-in,color 100ms ease-in;font-family:inherit;font-weight:600;-webkit-text-decoration:none;text-decoration:none;position:relative;margin:0;border-radius:4px;cursor:pointer;color:rgb(255, 255, 255);background-color:rgb(18, 28, 45);box-shadow:0 0 0 1px #394762;padding:0.25rem;}.css-11aawc9:hover{-webkit-text-decoration:none;text-decoration:none;color:rgb(255, 255, 255);background-color:rgb(31, 48, 76);box-shadow:0 0 0 1px #f4f4f6;}.css-11aawc9:focus{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #394762,0 0 0 3px #121c2d,0 0 0 4px #ffffff,0 0 0 6px rgba(255, 255, 255, 0.2);}.css-11aawc9:active,.css-11aawc9[data-active=true]{-webkit-text-decoration:none;text-decoration:none;box-shadow:0 0 0 1px #ffffff;color:rgb(255, 255, 255);background-color:rgb(31, 48, 76);}</style><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":R16da2claatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R6j76da2claatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><style data-emotion="css 1cbdvo6">.css-1cbdvo6{box-sizing:border-box;border:none;clip:rect(0 0 0 0);height:1px;margin:-0.125rem;overflow:hidden;padding:0;position:absolute;text-transform:none;white-space:nowrap;width:1px;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><style data-emotion="css 1yf26d7">.css-1yf26d7{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow-x:auto;grid-area:code-block;}</style><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><style data-emotion="css 1p78m0">.css-1p78m0{display:grid;}.css-1p78m0:focus{outline:none;box-shadow:inset 0 0 0 1px #006dfa,inset 0 0 0 3px #cce4ff;border-radius:4px;}</style><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css 1m136ci">.css-1m136ci{box-sizing:border-box;display:inline-block;box-sizing:content-box;opacity:0.5;padding-left:1.5rem;padding-right:1.5ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-width:2ch;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><style data-emotion="css luzz01">.css-luzz01{box-sizing:border-box;display:inline-block;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'/names.json'</span><span style="color:#C9D1D9">: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">path:</span> <span style="color:#A5D6FF">'/var/task/files/ZNdad14da2e70d2533f640cf362fec0609'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">open: [Function: open]</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'/rickroll.mp3'</span><span style="color:#C9D1D9">: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">path:</span> <span style="color:#A5D6FF">'/var/task/files/ZNdfbfaf15a02e244fa11337548dabd9d0'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">open: [Function: open]</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'/helper-method.js'</span><span style="color:#C9D1D9">: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">path:</span> <span style="color:#A5D6FF">'/var/task/files/ZN5d6d933785a76da25056328a5764d49b'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">open: [Function: open]</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">}</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">}</span></div></div></div></div></pre></div></div></div></div><style data-emotion="css irnnze">.css-irnnze{margin-top:1.5rem;margin-bottom:1.5rem;}.css-irnnze h1,.css-irnnze h2,.css-irnnze h3,.css-irnnze h4,.css-irnnze h5,.css-irnnze h6,.css-irnnze p,.css-irnnze li,.css-irnnze ul,.css-irnnze ol,.css-irnnze [data-paste-element=DISCLOSURE] span[data-paste-element=HEADING]{color:inherit;}[data-paste-element=HORIZONTAL_TAB_PANEL] .css-irnnze{margin-top:0;}</style><style data-emotion="css rj5eb">.css-rj5eb{box-sizing:border-box;margin-top:1.5rem;margin-bottom:1.5rem;}.css-rj5eb h1,.css-rj5eb h2,.css-rj5eb h3,.css-rj5eb h4,.css-rj5eb h5,.css-rj5eb h6,.css-rj5eb p,.css-rj5eb li,.css-rj5eb ul,.css-rj5eb ol,.css-rj5eb [data-paste-element=DISCLOSURE] span[data-paste-element=HEADING]{color:inherit;}[data-paste-element=HORIZONTAL_TAB_PANEL] .css-rj5eb{margin-top:0;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-rj5eb"><style data-emotion="css 1tn0jga">.css-1tn0jga{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:1.5rem;border-left-style:solid;border-left-width:2px;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;-webkit-column-gap:1rem;column-gap:1rem;background-color:rgb(249, 249, 250);color:rgb(141, 49, 24);border-color:rgb(255, 179, 122);}</style><div data-paste-element="CALLOUT" data-paste-core-version="20.7.0" class="css-1tn0jga"><div data-paste-element="CALLOUT_ICON" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css 5ybmgr">.css-5ybmgr{box-sizing:border-box;line-height:0;display:block;color:rgb(195, 83, 35);width:1.25rem;height:1.25rem;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}</style><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-5ybmgr"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="WarningIcon-:R6daiclaatasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M17.798 14.791L11.316 3.744c-.582-.992-2.05-.992-2.632 0L2.202 14.79C1.625 15.776 2.354 17 3.518 17h12.964c1.164 0 1.893-1.224 1.316-2.209zM9.99 8h.02c.611.007 1.073.592.978 1.244l-.428 2.238c-.04.296-.278.518-.557.518h-.006c-.279 0-.516-.222-.557-.518l-.428-2.238C8.917 8.592 9.386 8 9.99 8zm.01 7a1 1 0 100-2 1 1 0 000 2z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">(warning)</span></div><style data-emotion="css fkfdww">.css-fkfdww{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;row-gap:0.5rem;-webkit-flex:1;-ms-flex:1;flex:1;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-fkfdww"><style data-emotion="css kevsq9">.css-kevsq9{margin:0;padding:0;color:currentColor;font-size:0.875rem;line-height:1.25rem;font-weight:600;}</style><h2 data-paste-element="CALLOUT_HEADING" data-paste-core-version="20.6.0" class="css-kevsq9">Warning</h2><style data-emotion="css 8tmauh">.css-8tmauh{display:grid;grid-gap:0;word-break:break-word;}.css-8tmauh >:last-child{margin-bottom:0;}.css-8tmauh ul,.css-8tmauh ol{margin-top:-0.5rem;}</style><style data-emotion="css 1ircowi">.css-1ircowi{box-sizing:border-box;display:grid;grid-gap:0;word-break:break-word;}.css-1ircowi >:last-child{margin-bottom:0;}.css-1ircowi ul,.css-1ircowi ol{margin-top:-0.5rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ircowi"><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getAssets()</code> only returns <strong>private</strong> Assets. Public and protected assets can be accessed via their publicly facing urls without the need for calling <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getAssets()</code>. Refer to the <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/visibility" title="visibility guide" class="css-lpeit6">visibility guide</a> for more context!</p></div></div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-rj5eb"><div data-paste-element="CALLOUT" data-paste-core-version="20.7.0" class="css-1tn0jga"><div data-paste-element="CALLOUT_ICON" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-5ybmgr"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="WarningIcon-:R6db2claatasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M17.798 14.791L11.316 3.744c-.582-.992-2.05-.992-2.632 0L2.202 14.79C1.625 15.776 2.354 17 3.518 17h12.964c1.164 0 1.893-1.224 1.316-2.209zM9.99 8h.02c.611.007 1.073.592.978 1.244l-.428 2.238c-.04.296-.278.518-.557.518h-.006c-.279 0-.516-.222-.557-.518l-.428-2.238C8.917 8.592 9.386 8 9.99 8zm.01 7a1 1 0 100-2 1 1 0 000 2z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">(warning)</span></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-fkfdww"><h2 data-paste-element="CALLOUT_HEADING" data-paste-core-version="20.6.0" class="css-kevsq9">Warning</h2><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ircowi"><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Note that an Asset such as <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">names.json</code> will be returned with a key of <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">'/names.json'</code>. To correctly retrieve the Asset and its path, the leading <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">/</code> and extension must be part of the key used to access the object returned by <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getAssets()</code>.</p><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">For example: <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getAssets()['/names.json'].path</code></p></div></div></div></div></section> <section id="asset-properties-section"><style data-emotion="css 104sreq">.css-104sreq{box-sizing:border-box;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;margin-bottom:0.75rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><style data-emotion="css 3y2hwy">.css-3y2hwy{margin:0;padding:0;color:rgb(18, 28, 45);font-size:1rem;line-height:1.5rem;margin-bottom:0.5rem;font-weight:600;letter-spacing:-.02em;display:inline;}</style><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="asset-properties" class="css-3y2hwy">Asset Properties</h4><style data-emotion="css 138wi13">.css-138wi13{box-sizing:border-box;-webkit-text-decoration:none;text-decoration:none;margin-left:0.5rem;color:rgb(96, 107, 133);border-radius:2px;outline:none;display:inline-block;vertical-align:text-bottom;}.css-138wi13:hover{color:rgb(3, 11, 93);}.css-138wi13:focus{box-shadow:0 0 0 2px #ffffff,0 0 0 3px #006dfa,0 0 0 5px #cce4ff;color:rgb(3, 11, 93);}</style><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#asset-properties" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kislaatasm:"><title id="LinkIcon-:R2kislaatasm:">asset-properties page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><style data-emotion="css 161rs34">.css-161rs34{box-sizing:border-box;margin-bottom:1.25rem;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-161rs34"><style data-emotion="css 1pev1tl">.css-1pev1tl{box-sizing:border-box;overflow-x:auto;}</style><div data-paste-element="TABLE_WRAPPER" data-paste-core-version="20.7.0" class="css-1pev1tl"><style data-emotion="css 1yrg7uf">.css-1yrg7uf{box-sizing:border-box;border-collapse:separate;border-color:rgb(225, 227, 234);border-spacing:0;border-style:solid;border-width:1px;table-layout:auto;width:100%;}</style><table data-paste-element="TABLE" data-paste-core-version="20.7.0" class="css-1yrg7uf"><style data-emotion="css c08gur">.css-c08gur{background-color:rgb(249, 249, 250);color:rgb(96, 107, 133);box-sizing:border-box;}</style><thead data-paste-element="THEAD" data-paste-core-version="20.7.0" class="css-c08gur"><style data-emotion="css 1e22c8r">.css-1e22c8r{box-sizing:border-box;vertical-align:middle;}.css-1e22c8r:nth-of-type(even){background-color:transparent;}.css-1e22c8r:last-of-type{border-width:0;}</style><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><style data-emotion="css kczchh">.css-kczchh{box-sizing:border-box;border-bottom-style:solid;border-bottom-color:rgb(225, 227, 234);border-bottom-width:1px;font-size:0.875rem;line-height:1.25rem;font-weight:600;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;padding-top:0.75rem;position:relative;text-align:left;vertical-align:inherit;word-wrap:break-word;color:inherit;}</style><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Property</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Type</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Description</strong></th></tr></thead><style data-emotion="css dzsvvb">.css-dzsvvb{box-sizing:border-box;color:rgb(18, 28, 45);}</style><style data-emotion="css 1u05hs8">.css-1u05hs8{background-color:rgb(255, 255, 255);box-sizing:border-box;color:rgb(18, 28, 45);}.css-1u05hs8>tr:last-of-type>td{border-bottom-width:0;}.css-1u05hs8>tr:last-of-type>th{border-bottom-width:0;}</style><tbody data-paste-element="TBODY" data-paste-core-version="20.7.0" class="css-1u05hs8"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><style data-emotion="css 4rjmal">.css-4rjmal{box-sizing:border-box;border-style:solid;border-color:rgb(225, 227, 234);border-width:0;border-bottom-width:1px;font-size:0.875rem;line-height:1.25rem;padding:1rem;position:relative;text-align:left;vertical-align:inherit;word-wrap:break-word;color:inherit;}</style><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">path</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">string</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal">String specifying the location of the private Asset</td></tr><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">open</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">function</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal">Convenience method that returns the contents of the file from <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">path</code> in utf8 encoding</td></tr></tbody></table></div></div></section> <section id="examples-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="examples" class="css-3y2hwy">Examples</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#examples" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kjclaatasm:"><title id="LinkIcon-:R2kjclaatasm:">examples page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-rj5eb"><style data-emotion="css 1v816ix">.css-1v816ix{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:1.5rem;border-left-style:solid;border-left-width:2px;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;-webkit-column-gap:1rem;column-gap:1rem;background-color:rgb(249, 249, 250);color:rgb(3, 11, 93);border-color:rgb(102, 179, 255);}</style><div data-paste-element="CALLOUT" data-paste-core-version="20.7.0" class="css-1v816ix"><div data-paste-element="CALLOUT_ICON" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css 1cst9vu">.css-1cst9vu{box-sizing:border-box;line-height:0;display:block;color:rgb(3, 11, 93);width:1.25rem;height:1.25rem;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;}</style><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-1cst9vu"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="NeutralIcon-:R36l3claatasm:"><path fill="currentColor" fill-rule="evenodd" d="M10 2a8 8 0 110 16 8 8 0 010-16zm0 7c-.26.01-.528.08-.707.24-.178.158-.292.355-.292.575v3.37c0 .21.11.428.292.577.173.14.457.247.707.237.26-.008.528-.078.707-.237.178-.16.292-.355.292-.577v-3.37a.766.766 0 00-.292-.575A1.14 1.14 0 0010 9zm0-3l-.266.036c-.17.047-.318.131-.441.253l-.156.198A.958.958 0 009 6.98v.04a.728.728 0 00.086.378c.04.121.108.227.206.315.09.094.197.163.321.202.12.06.248.09.386.084l.266-.035c.17-.047.318-.131.441-.253l.156-.198A.958.958 0 0011 7.02v-.04a.728.728 0 00-.086-.378.721.721 0 00-.206-.315.757.757 0 00-.321-.202.767.767 0 00-.386-.084z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">(information)</span></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-fkfdww"><h2 data-paste-element="CALLOUT_HEADING" data-paste-core-version="20.6.0" class="css-kevsq9">Info</h2><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ircowi"><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">If you would like to include a JavaScript module that isn't available on npm, the best way to do so is to upload the module as a <strong>private</strong> Asset, then use <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getAssets</code> in order to require the module as shown in the <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/serverless/functions-assets/client#load-a-module-from-an-asset" title="Load a module from an asset" class="css-lpeit6">Load a module from an asset</a> code example.</p></div></div></div></div></section> <section id="retrieve-the-path-of-an-asset-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="retrieve-the-path-of-an-asset" class="css-3y2hwy">Retrieve the path of an Asset</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#retrieve-the-path-of-an-asset" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kjslaatasm:"><title id="LinkIcon-:R2kjslaatasm:">retrieve-the-path-of-an-asset page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to get the file path for an Asset</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6ljslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6ljslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css 519pyc">.css-519pyc{box-sizing:border-box;display:inline-block;box-sizing:content-box;opacity:0.5;padding-left:1.5rem;padding-right:1.5ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;min-width:1ch;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= function</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Note: the leading slash and file extension are necessary to access the Asset</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">path</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getAssets</span><span style="color:#C9D1D9">()[</span><span style="color:#A5D6FF">'/my-asset.json'</span><span style="color:#C9D1D9">].path;</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'The path is: '</span> <span style="color:#FF7B72">+</span> <span style="color:#C9D1D9">path);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="load-a-module-from-an-asset-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="load-a-module-from-an-asset" class="css-3y2hwy">Load a module from an Asset</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#load-a-module-from-an-asset" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kkclaatasm:"><title id="LinkIcon-:R2kkclaatasm:">load-a-module-from-an-asset page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to load a third party library stored in an Asset</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lkclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lkclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= function</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// First, get the path for the Asset</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">path</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getAssets</span><span style="color:#C9D1D9">()[</span><span style="color:#A5D6FF">'/answer-generator.js'</span><span style="color:#C9D1D9">].path;</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Next, you can use require() to import the library</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">module</span> <span style="color:#FF7B72">=</span> <span style="color:#D2A8FF">require</span><span style="color:#C9D1D9">(path);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Finally, use the module as you would any other!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'The answer to your riddle is: '</span> <span style="color:#FF7B72">+</span> <span style="color:#79C0FF">module</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">getAnswer</span><span style="color:#C9D1D9">());</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="read-the-contents-of-an-asset-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="read-the-contents-of-an-asset" class="css-3y2hwy">Read the contents of an Asset</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#read-the-contents-of-an-asset" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kkslaatasm:"><title id="LinkIcon-:R2kkslaatasm:">read-the-contents-of-an-asset page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Leverage the built-in open method for convenience</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lkslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lkslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= function</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">openFile</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getAssets</span><span style="color:#C9D1D9">()[</span><span style="color:#A5D6FF">'/my_file.txt'</span><span style="color:#C9D1D9">].open;</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Calling open is equivalent to using fs.readFileSync(asset.filePath, 'utf8')</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">text</span> <span style="color:#FF7B72">=</span> <span style="color:#D2A8FF">openFile</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Your file contents: '</span> <span style="color:#FF7B72">+</span> <span style="color:#C9D1D9">text);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="read-the-contents-of-an-asset-1-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="read-the-contents-of-an-asset-1" class="css-3y2hwy">Read the contents of an Asset</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#read-the-contents-of-an-asset-1" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2klclaatasm:"><title id="LinkIcon-:R2klclaatasm:">read-the-contents-of-an-asset-1 page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Directly read the contents of an Asset using filesystem methods</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6llclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6llclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#8B949E">// We're reading a file from the file system, so we'll need to import fs</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#FF7B72">const</span> <span style="color:#79C0FF">fs</span> <span style="color:#FF7B72">=</span> <span style="color:#D2A8FF">require</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'fs'</span><span style="color:#C9D1D9">);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= async function</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Retrieve the path of your file</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">file</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getAssets</span><span style="color:#C9D1D9">()[</span><span style="color:#A5D6FF">'/my_file.txt'</span><span style="color:#C9D1D9">].path;</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Asynchronously read the file using a different encoding from utf8</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">text</span> <span style="color:#FF7B72">= await</span> <span style="color:#C9D1D9">fs.</span><span style="color:#D2A8FF">readFile</span><span style="color:#C9D1D9">(file,</span> <span style="color:#A5D6FF">'base64'</span><span style="color:#C9D1D9">);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Your file contents: '</span> <span style="color:#FF7B72">+</span> <span style="color:#C9D1D9">text);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="getfunctions-section-indexable"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-m8ey6p"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-a8lapc"><h3 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="getfunctions" class="css-yftbgj"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getFunctions()</code></h3><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#getfunctions" class="css-f02h4i"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R1aj8lslaatasm:"><title id="LinkIcon-:R1aj8lslaatasm:">getfunctions page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1kam78h"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-knmi57"><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsUpIcon-:R9jal8lslaatasm:"><title id="ThumbsUpIcon-:R9jal8lslaatasm:">Positive Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M6.5 7.45c.194-.216.406-.451.628-.707.799-.922 1.608-1.972 1.898-2.838.314-.938 1.139-1.487 1.966-1.395a1.57 1.57 0 011.085.621c.277.363.423.85.423 1.43 0 .327-.081.645-.174.924-.062.186-.139.383-.208.56l-.088.226c-.092.245-.15.432-.166.582-.014.134.01.19.033.222l.001.001a.415.415 0 00.1.058 1.9 1.9 0 00.371.11c.32.068.725.106 1.152.124.632.026 1.237.01 1.634-.002.147-.004.265-.008.345-.008.25 0 .731.008 1.158.218.224.11.443.28.603.537.159.256.239.567.239.924 0 1.218-.524 3.647-1.553 5.695-.31.616-.693.885-1.18 1.193-.574.364-1.145.575-1.767.575h-3c-1.116 0-2.204-.418-3.002-.883a6.393 6.393 0 01-.498-.322v.372a.5.5 0 01-.5.5H3a.5.5 0 01-.5-.5V7a.5.5 0 01.5-.5h3a.5.5 0 01.5.5v.45zm3.474-3.228c.186-.554.611-.751.909-.718a.57.57 0 01.399.233c.114.15.218.409.218.824 0 .17-.044.37-.123.61a9.287 9.287 0 01-.177.474c-.034.087-.07.177-.105.273-.095.252-.194.542-.225.827-.032.297.005.636.23.935.135.178.322.291.491.367.175.078.372.134.571.176.4.084.869.125 1.317.144.676.028 1.382.008 1.767-.003.118-.003.206-.006.254-.006.25 0 .519.018.717.115.088.044.15.098.194.168.044.07.089.19.089.396 0 1.04-.476 3.316-1.447 5.246-.184.367-.375.516-.82.797-.468.296-.855.42-1.233.42h-3c-.884 0-1.796-.338-2.498-.747a4.464 4.464 0 01-.813-.591 1.36 1.36 0 01-.184-.207l-.005-.008V8.968a7.331 7.331 0 01.329-.39l.308-.343c.223-.246.483-.534.746-.837.788-.909 1.73-2.097 2.091-3.176zM5.5 7.5h-2v7.667h2V7.5z"></path></svg></span></span></button><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsDownIcon-:R9lal8lslaatasm:"><title id="ThumbsDownIcon-:R9lal8lslaatasm:">Negative Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M13.5 12.55c-.194.215-.406.451-.628.707-.799.921-1.608 1.972-1.898 2.838-.314.938-1.139 1.487-1.966 1.395a1.57 1.57 0 01-1.085-.621c-.277-.363-.423-.85-.423-1.43 0-.327.081-.645.174-.924.062-.186.139-.383.208-.56l.088-.226c.092-.245.15-.432.166-.582.014-.134-.01-.19-.033-.222l-.001-.001a.416.416 0 00-.1-.058 1.902 1.902 0 00-.371-.11 7.35 7.35 0 00-1.152-.124 22.958 22.958 0 00-1.634.002 14.2 14.2 0 01-.345.008c-.25 0-.731-.008-1.158-.218a1.451 1.451 0 01-.603-.537c-.159-.257-.239-.567-.239-.924 0-1.218.524-3.648 1.553-5.696.31-.616.693-.884 1.18-1.192C5.807 3.71 6.378 3.5 7 3.5h3c1.116 0 2.204.417 3.002.883.178.104.345.212.498.321v-.37a.5.5 0 01.5-.5h3a.5.5 0 01.5.5V13a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5v-.45zm-3.474 3.227c-.186.554-.611.752-.909.72a.571.571 0 01-.399-.234c-.114-.15-.218-.409-.218-.824a2 2 0 01.123-.61c.054-.16.113-.312.177-.475.034-.086.07-.176.105-.272.095-.252.194-.542.225-.828.032-.296-.005-.635-.23-.934a1.23 1.23 0 00-.491-.367 2.874 2.874 0 00-.571-.176 8.31 8.31 0 00-1.317-.144c-.676-.029-1.381-.008-1.767.003-.118.003-.206.006-.254.006-.25 0-.519-.018-.717-.115a.452.452 0 01-.194-.168c-.044-.07-.089-.19-.089-.396 0-1.04.476-3.316 1.447-5.247.184-.366.375-.515.82-.796.468-.296.855-.42 1.233-.42h3c.884 0 1.796.337 2.498.747.349.203.628.414.813.59.093.09.152.16.184.208l.005.007v4.98a7.245 7.245 0 01-.329.39 54.1 54.1 0 01-.308.342c-.223.247-.483.534-.746.838-.788.909-1.73 2.096-2.091 3.175zM14.5 12.5h2V4.833h-2V12.5z"></path></svg></span></span></button></div></div></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">The <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getFunctions</code> method returns an object that contains the names of every Function in the Service. Each Function name serves as the key to a Function object that contains the <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">path</code> to that Function. These paths can be used to import code from other Functions and to compose code hosted on Twilio Functions.</p><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">For example, executing <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getFunctions()</code> could return an object with the following Functions:</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":R16da5slaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R6j76da5slaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'sms/reply'</span><span style="color:#C9D1D9">: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">path:</span> <span style="color:#A5D6FF">'/var/task/handlers/ZNdad14da2e70d2533f640cf362fec0609.js'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'helper'</span><span style="color:#C9D1D9">: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">path:</span> <span style="color:#A5D6FF">'/var/task/handlers/ZNdfbfaf15a02e244fa11337548dabd9d0.js'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'example-function'</span><span style="color:#C9D1D9">: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">path:</span> <span style="color:#A5D6FF">'/var/task/handlers/ZN5d6d933785a76da25056328a5764d49b.js'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">}</span></div></div></div></div></pre></div></div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-rj5eb"><div data-paste-element="CALLOUT" data-paste-core-version="20.7.0" class="css-1tn0jga"><div data-paste-element="CALLOUT_ICON" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-5ybmgr"><svg role="img" aria-hidden="true" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="WarningIcon-:R6dalslaatasm:"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M17.798 14.791L11.316 3.744c-.582-.992-2.05-.992-2.632 0L2.202 14.79C1.625 15.776 2.354 17 3.518 17h12.964c1.164 0 1.893-1.224 1.316-2.209zM9.99 8h.02c.611.007 1.073.592.978 1.244l-.428 2.238c-.04.296-.278.518-.557.518h-.006c-.279 0-.516-.222-.557-.518l-.428-2.238C8.917 8.592 9.386 8 9.99 8zm.01 7a1 1 0 100-2 1 1 0 000 2z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">(warning)</span></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-fkfdww"><h2 data-paste-element="CALLOUT_HEADING" data-paste-core-version="20.6.0" class="css-kevsq9">Warning</h2><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ircowi"><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Note that, unlike an Asset, a Function such as <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">sms/reply.js</code> will be returned with a key of <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">"sms/reply"</code>. To correctly retrieve the Function and its path, do <em>not</em> include characters such as a leading slash or the <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">.js</code> extension in the key used to access the object returned by <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getFunctions()</code>.</p><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">For example: <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getFunctions()["sms/reply"].path</code></p></div></div></div></div></section> <section id="function-properties-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="function-properties" class="css-3y2hwy">Function Properties</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#function-properties" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kmclaatasm:"><title id="LinkIcon-:R2kmclaatasm:">function-properties page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-161rs34"><div data-paste-element="TABLE_WRAPPER" data-paste-core-version="20.7.0" class="css-1pev1tl"><table data-paste-element="TABLE" data-paste-core-version="20.7.0" class="css-1yrg7uf"><thead data-paste-element="THEAD" data-paste-core-version="20.7.0" class="css-c08gur"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Property</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Type</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Description</strong></th></tr></thead><tbody data-paste-element="TBODY" data-paste-core-version="20.7.0" class="css-1u05hs8"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">path</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">string</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal">String specifying the location of the Function</td></tr></tbody></table></div></div></section> <section id="examples-2-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="examples-2" class="css-3y2hwy">Examples</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#examples-2" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:Rl6slaatasm:"><title id="LinkIcon-:Rl6slaatasm:">examples-2 page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div></section> <section id="retrieve-the-path-for-a-function-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="retrieve-the-path-for-a-function" class="css-3y2hwy">Retrieve the path for a Function</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#retrieve-the-path-for-a-function" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2knclaatasm:"><title id="LinkIcon-:R2knclaatasm:">retrieve-the-path-for-a-function page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to retrieve the file path for a Function</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lnclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lnclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= function</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Get the path for the Function. Note that the key of the function</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// is not preceded by a "/" as is the case with Assets</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">path</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getFunctions</span><span style="color:#C9D1D9">()[</span><span style="color:#A5D6FF">'example-function'</span><span style="color:#C9D1D9">].path;</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'The path to your Function is: '</span> <span style="color:#FF7B72">+</span> <span style="color:#C9D1D9">path);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-519pyc">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="include-a-private-function-in-another-function-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="include-a-private-function-in-another-function" class="css-3y2hwy">Include a private Function in another Function</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#include-a-private-function-in-another-function" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2knslaatasm:"><title id="LinkIcon-:R2knslaatasm:">include-a-private-function-in-another-function page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Private Functions are a great way to store methods that may be reused between your other Functions. For example, lets say we have a private Function called <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Zoltar</code> that exports a fortune-generating method, <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">ask</code>:</p></section> <section id="define-a-private-helper-function-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="define-a-private-helper-function" class="css-3y2hwy">Define a private helper Function</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#define-a-private-helper-function" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R58oclaatasm:"><title id="LinkIcon-:R58oclaatasm:">define-a-private-helper-function page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Implement Zoltar and define an ask method</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":R16d9oclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R6j76d9oclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">ask</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">()</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// We're not totally sure if Zoltar's advice is all that helpful</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">fortunes</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">[</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'A long-forgotten loved one will appear soon.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Are you sure the back door is locked?'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">"Communicate! It can't make things any worse."</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Do not sleep in a eucalyptus tree tonight.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Fine day for friends.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Good news. Ten weeks from Friday will be a pretty good day.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Living your life is a task so difficult, it has never been attempted before.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Stay away from flying saucers today.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'The time is right to make new friends.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Try to relax and enjoy the crisis.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'You need more time; and you probably always will.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#A5D6FF">'Your business will assume vast proportions.'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">];</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">17</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">18</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Generate a random index and return the given fortune</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">19</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#C9D1D9">fortunes[Math.</span><span style="color:#D2A8FF">floor</span><span style="color:#C9D1D9">(Math.</span><span style="color:#D2A8FF">random</span><span style="color:#C9D1D9">()</span> <span style="color:#FF7B72">*</span> <span style="color:#C9D1D9">fortunes.</span><span style="color:#79C0FF">length</span><span style="color:#C9D1D9">)];</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">20</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">You could then access this private method by using <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getFunctions()</code> to get the path for the Zoltar Function, import Zoltar as a JavaScript module using <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">require</code>, and then access the <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">ask</code> method as in the following code sample:</p></section> <section id="include-code-from-a-function-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="include-code-from-a-function" class="css-3y2hwy">Include code from a Function</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#include-code-from-a-function" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2koslaatasm:"><title id="LinkIcon-:R2koslaatasm:">include-code-from-a-function page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to include code from other Functions</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6loslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6loslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= function</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// First, get the path for the Function. Note that the key of the function</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// is not preceded by a "/" as is the case with Assets</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">zoltarPath</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getFunctions</span><span style="color:#C9D1D9">()[</span><span style="color:#A5D6FF">'zoltar'</span><span style="color:#C9D1D9">].path;</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <!-- --> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Next, use require() to import the library</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">zoltar</span> <span style="color:#FF7B72">=</span> <span style="color:#D2A8FF">require</span><span style="color:#C9D1D9">(zoltarPath);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <!-- --> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Finally, use the module as you would any other!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'The answer to your riddle is: '</span> <span style="color:#FF7B72">+</span> <span style="color:#C9D1D9">zoltar.</span><span style="color:#D2A8FF">ask</span><span style="color:#C9D1D9">());</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <!-- --> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">}</span></div></div></div></div></pre></div></div></div></div></section> <section id="getsyncoptions-section-indexable"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-m8ey6p"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-a8lapc"><h3 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="getsyncoptions" class="css-yftbgj"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getSync(options?)</code></h3><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#getsyncoptions" class="css-f02h4i"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R1aj8pclaatasm:"><title id="LinkIcon-:R1aj8pclaatasm:">getsyncoptions page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1kam78h"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-knmi57"><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsUpIcon-:R9jal8pclaatasm:"><title id="ThumbsUpIcon-:R9jal8pclaatasm:">Positive Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M6.5 7.45c.194-.216.406-.451.628-.707.799-.922 1.608-1.972 1.898-2.838.314-.938 1.139-1.487 1.966-1.395a1.57 1.57 0 011.085.621c.277.363.423.85.423 1.43 0 .327-.081.645-.174.924-.062.186-.139.383-.208.56l-.088.226c-.092.245-.15.432-.166.582-.014.134.01.19.033.222l.001.001a.415.415 0 00.1.058 1.9 1.9 0 00.371.11c.32.068.725.106 1.152.124.632.026 1.237.01 1.634-.002.147-.004.265-.008.345-.008.25 0 .731.008 1.158.218.224.11.443.28.603.537.159.256.239.567.239.924 0 1.218-.524 3.647-1.553 5.695-.31.616-.693.885-1.18 1.193-.574.364-1.145.575-1.767.575h-3c-1.116 0-2.204-.418-3.002-.883a6.393 6.393 0 01-.498-.322v.372a.5.5 0 01-.5.5H3a.5.5 0 01-.5-.5V7a.5.5 0 01.5-.5h3a.5.5 0 01.5.5v.45zm3.474-3.228c.186-.554.611-.751.909-.718a.57.57 0 01.399.233c.114.15.218.409.218.824 0 .17-.044.37-.123.61a9.287 9.287 0 01-.177.474c-.034.087-.07.177-.105.273-.095.252-.194.542-.225.827-.032.297.005.636.23.935.135.178.322.291.491.367.175.078.372.134.571.176.4.084.869.125 1.317.144.676.028 1.382.008 1.767-.003.118-.003.206-.006.254-.006.25 0 .519.018.717.115.088.044.15.098.194.168.044.07.089.19.089.396 0 1.04-.476 3.316-1.447 5.246-.184.367-.375.516-.82.797-.468.296-.855.42-1.233.42h-3c-.884 0-1.796-.338-2.498-.747a4.464 4.464 0 01-.813-.591 1.36 1.36 0 01-.184-.207l-.005-.008V8.968a7.331 7.331 0 01.329-.39l.308-.343c.223-.246.483-.534.746-.837.788-.909 1.73-2.097 2.091-3.176zM5.5 7.5h-2v7.667h2V7.5z"></path></svg></span></span></button><button data-paste-element="BUTTON" data-paste-core-version="20.7.0" aria-pressed="false" type="button" aria-busy="false" class="css-1b15v5e"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" width="100%" height="100%" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" aria-labelledby="ThumbsDownIcon-:R9lal8pclaatasm:"><title id="ThumbsDownIcon-:R9lal8pclaatasm:">Negative Feedback</title><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M13.5 12.55c-.194.215-.406.451-.628.707-.799.921-1.608 1.972-1.898 2.838-.314.938-1.139 1.487-1.966 1.395a1.57 1.57 0 01-1.085-.621c-.277-.363-.423-.85-.423-1.43 0-.327.081-.645.174-.924.062-.186.139-.383.208-.56l.088-.226c.092-.245.15-.432.166-.582.014-.134-.01-.19-.033-.222l-.001-.001a.416.416 0 00-.1-.058 1.902 1.902 0 00-.371-.11 7.35 7.35 0 00-1.152-.124 22.958 22.958 0 00-1.634.002 14.2 14.2 0 01-.345.008c-.25 0-.731-.008-1.158-.218a1.451 1.451 0 01-.603-.537c-.159-.257-.239-.567-.239-.924 0-1.218.524-3.648 1.553-5.696.31-.616.693-.884 1.18-1.192C5.807 3.71 6.378 3.5 7 3.5h3c1.116 0 2.204.417 3.002.883.178.104.345.212.498.321v-.37a.5.5 0 01.5-.5h3a.5.5 0 01.5.5V13a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5v-.45zm-3.474 3.227c-.186.554-.611.752-.909.72a.571.571 0 01-.399-.234c-.114-.15-.218-.409-.218-.824a2 2 0 01.123-.61c.054-.16.113-.312.177-.475.034-.086.07-.176.105-.272.095-.252.194-.542.225-.828.032-.296-.005-.635-.23-.934a1.23 1.23 0 00-.491-.367 2.874 2.874 0 00-.571-.176 8.31 8.31 0 00-1.317-.144c-.676-.029-1.381-.008-1.767.003-.118.003-.206.006-.254.006-.25 0-.519-.018-.717-.115a.452.452 0 01-.194-.168c-.044-.07-.089-.19-.089-.396 0-1.04.476-3.316 1.447-5.247.184-.366.375-.515.82-.796.468-.296.855-.42 1.233-.42h3c.884 0 1.796.337 2.498.747.349.203.628.414.813.59.093.09.152.16.184.208l.005.007v4.98a7.245 7.245 0 01-.329.39 54.1 54.1 0 01-.308.342c-.223.247-.483.534-.746.838-.788.909-1.73 2.096-2.091 3.175zM14.5 12.5h2V4.833h-2V12.5z"></path></svg></span></span></button></div></div></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">We've made it convenient for you to access the Sync REST API from Functions. Use the Runtime Client to access any of <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/sync/objects-overview" title="Sync's real-time data primitives" class="css-lpeit6">Sync's real-time data primitives</a> and store information between Function invocations. The same data can be accessed using the <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/sync/api" title="Sync API library" class="css-lpeit6">Sync API library</a>, making Sync from Functions the perfect way to update your real-time apps and dashboards.</p><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">The Runtime Client provides a wrapper around the Twilio REST API Helper for <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="/docs/sync" title="Twilio Sync" class="css-lpeit6">Twilio Sync</a>. By default, calling <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">Runtime.getSync()</code> will return a Sync Service object that has been configured to work with your default Sync Instance.</p><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">For added convenience and less typing, the following methods returned from <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getSync</code> are renamed from their usual name in the Node.js SDK, as you will see in the examples.</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-161rs34"><div data-paste-element="TABLE_WRAPPER" data-paste-core-version="20.7.0" class="css-1pev1tl"><table data-paste-element="TABLE" data-paste-core-version="20.7.0" class="css-1yrg7uf"><thead data-paste-element="THEAD" data-paste-core-version="20.7.0" class="css-c08gur"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Default method name</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Method name in Functions</strong></th></tr></thead><tbody data-paste-element="TBODY" data-paste-core-version="20.7.0" class="css-1u05hs8"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">syncMaps</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">maps</code></td></tr><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">syncLists</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">lists</code></td></tr></tbody></table></div></div></section> <section id="arguments-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="arguments" class="css-3y2hwy">Arguments</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#arguments" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kpslaatasm:"><title id="LinkIcon-:R2kpslaatasm:">arguments page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">getSync</code> optionally accepts a configuration object with the following properties.</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-161rs34"><div data-paste-element="TABLE_WRAPPER" data-paste-core-version="20.7.0" class="css-1pev1tl"><table data-paste-element="TABLE" data-paste-core-version="20.7.0" class="css-1yrg7uf"><thead data-paste-element="THEAD" data-paste-core-version="20.7.0" class="css-c08gur"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Parameter</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Type</strong></th><th data-paste-element="TH" data-paste-core-version="20.7.0" class="css-kczchh"><strong>Description</strong></th></tr></thead><tbody data-paste-element="TBODY" data-paste-core-version="20.7.0" class="css-1u05hs8"><tr data-paste-element="TR" data-paste-core-version="20.7.0" class="css-1e22c8r"><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">serviceName</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal"><code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">string</code></td><td data-paste-element="TD" data-paste-core-version="20.7.0" class="css-4rjmal">String specifying either the <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">serviceSid</code> or <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">uniqueName</code> of the Sync Service to connect to. Defaults to <code data-paste-element="INLINE_CODE" data-paste-core-version="20.7.0" class="css-1kwd7zr">default</code>.</td></tr></tbody></table></div></div></section> <section id="examples-3-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="examples-3" class="css-3y2hwy">Examples</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#examples-3" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:Rlaclaatasm:"><title id="LinkIcon-:Rlaclaatasm:">examples-3 page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div></section> <section id="get-the-default-sync-service-instance-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="get-the-default-sync-service-instance" class="css-3y2hwy">Get the default Sync Service Instance</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#get-the-default-sync-service-instance" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kqslaatasm:"><title id="LinkIcon-:R2kqslaatasm:">get-the-default-sync-service-instance page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to get the default Sync Service Instance</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lqslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lqslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Use the getSync method with no arguments to get a reference to the default</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Sync document for your account. Fetch returns a Promise, which will</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// eventually resolve to metadata about the Sync Service, such as its SID</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">fetch</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">defaultSyncService</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Service SID: '</span><span style="color:#C9D1D9">, defaultSyncService.sid);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, defaultSyncService.sid);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="get-an-existing-sync-service-instance-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="get-an-existing-sync-service-instance" class="css-3y2hwy">Get an existing Sync Service Instance</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#get-an-existing-sync-service-instance" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2krclaatasm:"><title id="LinkIcon-:R2krclaatasm:">get-an-existing-sync-service-instance page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to use Runtime Client to get an Sync Service Instance by providing the SID</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lrclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lrclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Pass a serviceName to getSync to get a reference to that specific</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Sync document on your account. Fetch returns a Promise, which will</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// eventually resolve to metadata about the Sync Service, such as friendlyName</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">({ serviceName:</span> <span style="color:#A5D6FF">'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'</span> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">fetch</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">syncService</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Service Name: '</span> <span style="color:#FF7B72">+</span> <span style="color:#C9D1D9">syncService.friendlyName);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, syncService.friendlyName);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="create-a-sync-map-using-runtime-client-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="create-a-sync-map-using-runtime-client" class="css-3y2hwy">Create a Sync Map using Runtime Client</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#create-a-sync-map-using-runtime-client" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2krslaatasm:"><title id="LinkIcon-:R2krslaatasm:">create-a-sync-map-using-runtime-client page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to create a Map in Sync with the Runtime Client</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lrslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lrslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// maps, which is a shortcut to syncMaps, allows you to create a new Sync Map</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// instance. Be sure to provide a uniqueName identifier!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.maps.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">uniqueName:</span> <span style="color:#A5D6FF">'spaceShips'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">newMap</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(newMap);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, newMap);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="add-entry-to-a-sync-map-with-runtime-client-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="add-entry-to-a-sync-map-with-runtime-client" class="css-3y2hwy">Add entry to a Sync Map with Runtime Client</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#add-entry-to-a-sync-map-with-runtime-client" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2ksclaatasm:"><title id="LinkIcon-:R2ksclaatasm:">add-entry-to-a-sync-map-with-runtime-client page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to add an entry to a Sync Map with the Runtime Client</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lsclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lsclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Given an existing Sync Map with the uniqueName of spaceShips, you can use</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// syncMapItems.create to add a new key:data pair which will be accessible</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// to any other Function or product with access to the Sync Map!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">maps</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'spaceShips'</span><span style="color:#C9D1D9">)</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.syncMapItems.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">key:</span> <span style="color:#A5D6FF">'fastestShip'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">data: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">name:</span> <span style="color:#A5D6FF">'Millenium Falcon'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">response</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(response);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, response);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">17</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">18</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">19</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">20</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">21</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="create-a-sync-list-with-runtime-client-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="create-a-sync-list-with-runtime-client" class="css-3y2hwy">Create a Sync List with Runtime Client</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#create-a-sync-list-with-runtime-client" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2ksslaatasm:"><title id="LinkIcon-:R2ksslaatasm:">create-a-sync-list-with-runtime-client page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to create Sync List with Runtime Client</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6lsslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6lsslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// If your use case warrants a list data structure instead of a map, you</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// can instantiate a Sync List. As with Maps, be sure to provide a uniqueName!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.lists.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">uniqueName:</span> <span style="color:#A5D6FF">'spaceShips'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">newList</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(newList);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, newList);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="append-to-sync-list-with-runtime-client-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="append-to-sync-list-with-runtime-client" class="css-3y2hwy">Append to Sync List with Runtime Client</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#append-to-sync-list-with-runtime-client" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2ktclaatasm:"><title id="LinkIcon-:R2ktclaatasm:">append-to-sync-list-with-runtime-client page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to append to a Sync List using the Runtime Client</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6ltclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6ltclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Given an existing Sync List with the uniqueName of spaceShips, you can use</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// syncListItems.create to append a new data entry which will be accessible</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// to any other Function or product with access to the Sync List!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">lists</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'spaceShips'</span><span style="color:#C9D1D9">)</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.syncListItems.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">data: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">text:</span> <span style="color:#A5D6FF">'Millennium Falcon'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">response</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(response);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, response);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">17</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">18</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">19</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">20</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="create-a-sync-document-with-runtime-client-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="create-a-sync-document-with-runtime-client" class="css-3y2hwy">Create a Sync Document with Runtime Client</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#create-a-sync-document-with-runtime-client" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2ktslaatasm:"><title id="LinkIcon-:R2ktslaatasm:">create-a-sync-document-with-runtime-client page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of how to create a Sync Document using the Runtime Client</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6ltslaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6ltslaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Last but not least, it's also possible to create Sync Documents.</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// As always, remember to provide a uniqueName to identify your Document.</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">()</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.documents.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">uniqueName:</span> <span style="color:#A5D6FF">'userPreferences'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">data: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">greeting:</span> <span style="color:#A5D6FF">'Ahoyhoy!'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">then</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">newDoc</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(newDoc);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, newDoc);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">})</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">catch</span><span style="color:#C9D1D9">((</span><span style="color:#FFA657">error</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">17</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">18</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">19</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section> <section id="perform-multiple-sync-actions-in-a-function-section"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-104sreq"><h4 data-paste-element="HEADING" data-paste-core-version="20.6.0" id="perform-multiple-sync-actions-in-a-function" class="css-3y2hwy">Perform multiple Sync actions in a Function</h4><a data-paste-element="BOX" data-paste-core-version="20.7.0" href="#perform-multiple-sync-actions-in-a-function" class="css-138wi13"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" fill="none" viewBox="0 0 20 20" aria-labelledby="LinkIcon-:R2kuclaatasm:"><title id="LinkIcon-:R2kuclaatasm:">perform-multiple-sync-actions-in-a-function page anchor</title><path fill="currentColor" d="M13.074 5.674a2.3 2.3 0 013.252 3.252l-2.97 2.97A2.3 2.3 0 019.869 8.92a.5.5 0 10-.808-.588 3.3 3.3 0 005.004 4.272l2.97-2.97a3.3 3.3 0 00-4.667-4.666l-.467.466a.5.5 0 10.707.707l.467-.466z"></path><path fill="currentColor" d="M9.18 7.163a2.3 2.3 0 011.952 3.65.5.5 0 10.809.59A3.3 3.3 0 006.936 7.13l-2.97 2.97a3.3 3.3 0 004.667 4.667l.58-.58a.5.5 0 10-.707-.707l-.58.58a2.3 2.3 0 11-3.252-3.252l2.97-2.97c.409-.41.958-.652 1.536-.675z"></path></svg></span></a></div><p data-paste-element="PARAGRAPH" data-paste-core-version="20.6.0" class="css-tcah8o">Example of creating a Sync Map and adding data to it in the same Function execution</p><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-slcqjs"><div data-paste-element="CODE_BLOCK_WRAPPER" data-paste-core-version="20.7.0" class="css-1ft5k6i"><div data-paste-element="CODE_BLOCK" data-paste-core-version="20.7.0" class="css-1lrte93"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-ba3ttd"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><button data-paste-element="CODE_BLOCK_COPY_BUTTON" data-paste-core-version="20.7.0" type="button" tabindex="0" aria-describedby=":Rj6luclaatasm:" aria-busy="false" class="css-11aawc9"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1lgr57j"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="CopyIcon-:R39jj6luclaatasm:"><path fill="currentColor" fill-rule="evenodd" d="M13.469 2.5c.63 0 1.15.48 1.212 1.094l.007.125-.001 1.593h1.407c.73 0 1.331.558 1.4 1.271l.006.136v9.375c0 .776-.63 1.406-1.406 1.406H6.719c-.777 0-1.407-.63-1.407-1.406v-1.407H3.719c-.631 0-1.15-.48-1.213-1.094L2.5 13.47v-9.75c0-.631.48-1.15 1.094-1.213L3.72 2.5h9.75zm2.625 3.75H6.719a.469.469 0 00-.469.469v9.375c0 .259.21.468.469.468h9.375c.259 0 .468-.21.468-.468V6.719a.469.469 0 00-.468-.469zm-2.625-2.813h-9.75a.281.281 0 00-.274.217l-.007.065v9.75c0 .133.092.244.216.274l.065.007 1.593-.001v-7.03c0-.731.558-1.332 1.271-1.4l.136-.006 7.031-.001V3.719a.281.281 0 00-.217-.274l-.064-.007z"></path></svg></span><span data-paste-element="BOX" data-paste-core-version="20.7.0" aria-live="polite" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1cbdvo6">Copy code block</span></span></span></span></button></div></div><div data-paste-element="CODE_BLOCK_CONTENT" data-paste-core-version="20.7.0" class="css-1yf26d7"><pre data-theme="github-dark" data-lang="javascript" style="color:white;font-family:'TwilioSansMono', Courier, monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;font-size:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;margin:0;overflow:auto;background:inherit;width:100%;padding-bottom:2rem" tabindex="0" class="css-1p78m0" data-ch="true"><div style="min-width:fit-content"><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">1</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#79C0FF">exports</span><span style="color:#C9D1D9">.</span><span style="color:#D2A8FF">handler</span> <span style="color:#FF7B72">= async</span> <span style="color:#C9D1D9">(</span><span style="color:#FFA657">context</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">event</span><span style="color:#C9D1D9">,</span> <span style="color:#FFA657">callback</span><span style="color:#C9D1D9">)</span> <span style="color:#FF7B72">=></span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">2</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Grab a reference to the Sync object since we'll be using it a few times</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">3</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">sync</span> <span style="color:#FF7B72">=</span> <span style="color:#C9D1D9">Runtime.</span><span style="color:#D2A8FF">getSync</span><span style="color:#C9D1D9">();</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">4</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">5</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">try</span> <span style="color:#C9D1D9">{</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">6</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// First, lets create a brand new Sync Map</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">7</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">newMap</span> <span style="color:#FF7B72">= await</span> <span style="color:#C9D1D9">sync.maps.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({ uniqueName:</span> <span style="color:#A5D6FF">'quicklyUpdatedMap'</span> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">8</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'newMap: '</span><span style="color:#C9D1D9">, newMap);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">9</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">10</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Now, let's access that map and add a new item to it.</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">11</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Be sure to specify a unique key and data for the item!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">12</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Creation is an async operation, so we need to await it.</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">13</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">const</span> <span style="color:#79C0FF">newMapItem</span> <span style="color:#FF7B72">= await</span> <span style="color:#C9D1D9">sync.</span><span style="color:#D2A8FF">maps</span><span style="color:#C9D1D9">(newMap.sid).syncMapItems.</span><span style="color:#D2A8FF">create</span><span style="color:#C9D1D9">({</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">14</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">key:</span> <span style="color:#A5D6FF">'fastestShip'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">15</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">data: {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">16</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">name:</span> <span style="color:#A5D6FF">'Millenium Falcon'</span><span style="color:#C9D1D9">,</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">17</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">},</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">18</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">});</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">19</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">20</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Now that we have a new item, let's log and return it.</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">21</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">log</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'newMapItem: '</span><span style="color:#C9D1D9">, newMapItem);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">22</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(</span><span style="color:#79C0FF">null</span><span style="color:#C9D1D9">, newMapItem);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">23</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">}</span> <span style="color:#FF7B72">catch</span> <span style="color:#C9D1D9">(error) {</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">24</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#8B949E">// Be sure to log and return any errors that occur!</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">25</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">console.</span><span style="color:#D2A8FF">error</span><span style="color:#C9D1D9">(</span><span style="color:#A5D6FF">'Sync Error: '</span><span style="color:#C9D1D9">, error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">26</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#FF7B72">return</span> <span style="color:#D2A8FF">callback</span><span style="color:#C9D1D9">(error);</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">27</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div> <span style="color:#C9D1D9">}</span> </div></div></div><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1m136ci">28</span><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-luzz01"><div><span style="color:#C9D1D9">};</span></div></div></div></div></pre></div></div></div></div></section></div></div></div><style data-emotion="css n7gvag">.css-n7gvag{box-sizing:border-box;margin-top:2rem;margin-bottom:2rem;margin-left:1.75rem;margin-right:1.75rem;padding-top:4.75rem;position:relative;}@media screen and (min-width: 768px){.css-n7gvag{margin-top:2rem;margin-bottom:2rem;margin-left:1.75rem;margin-right:1.75rem;}}@media screen and (min-width: 1024px){.css-n7gvag{margin-top:3rem;margin-bottom:3rem;margin-left:2.25rem;margin-right:2.25rem;}}@media screen and (min-width: 1385px){.css-n7gvag{margin-left:2.75rem;margin-right:2.75rem;}}</style><footer data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-n7gvag"><style data-emotion="css pg6uce">.css-pg6uce{box-sizing:border-box;border-radius:4px;background-color:rgb(18, 28, 45);margin-top:0;padding-top:0;}@media screen and (min-width: 768px){.css-pg6uce{margin-top:0;padding-top:0;}}@media screen and (min-width: 1024px){.css-pg6uce{margin-top:0;padding-top:0;}}@media screen and (min-width: 1385px){.css-pg6uce{margin-top:0;padding-top:0;}}@media screen and (min-width: 1942px){.css-pg6uce{margin-top:4.75rem;padding-top:4.75rem;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-pg6uce"><style data-emotion="css wzkleb">.css-wzkleb{box-sizing:border-box;max-width:77rem;padding:2rem;margin-top:0.125rem;margin-left:auto;margin-right:auto;position:relative;}@media screen and (min-width: 768px){.css-wzkleb{padding:4.25rem;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-wzkleb"><style data-emotion="css 1xkeua1">.css-1xkeua1{box-sizing:border-box;display:none;right:0;position:absolute;}@media screen and (min-width: 768px){.css-1xkeua1{display:none;}}@media screen and (min-width: 1024px){.css-1xkeua1{display:none;}}@media screen and (min-width: 1385px){.css-1xkeua1{display:block;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1xkeua1"><img aria-hidden="true" role="img" alt="" loading="lazy" width="460" height="324" decoding="async" data-nimg="1" style="color:transparent" src="/_next/static/media/footer-min.eb6c3e3d.svg"/></div><style data-emotion="css 1bt0omd">.css-1bt0omd{box-sizing:border-box;position:relative;}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1bt0omd"><style data-emotion="css 1uxvx9z">.css-1uxvx9z{box-sizing:border-box;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-bottom:1.75rem;text-align:center;}@media screen and (min-width: 768px){.css-1uxvx9z{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;text-align:left;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1uxvx9z"><style data-emotion="css 1y16khy">.css-1y16khy{margin:0;padding:0;color:rgb(255, 255, 255);font-size:1.25rem;line-height:1.75rem;font-family:'TwilioSansDisplay','Inter var experimental','Inter var',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',sans-serif;font-weight:800;margin-top:0.75rem;}@media screen and (min-width: 400px){.css-1y16khy{font-size:2rem;line-height:2.5rem;margin-top:0;}}</style><h2 data-paste-element="TEXT" data-paste-core-version="20.6.0" class="css-1y16khy">Need some help?</h2></div><style data-emotion="css 1hxyz3w">.css-1hxyz3w{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;text-align:center;}@media screen and (min-width: 768px){.css-1hxyz3w{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;text-align:left;}}</style><nav data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1hxyz3w"><style data-emotion="css 1b5a60l">.css-1b5a60l{box-sizing:border-box;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;margin-bottom:1.25rem;margin-right:0;max-width:100%;}@media screen and (min-width: 768px){.css-1b5a60l{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;margin-right:3rem;max-width:100%;}}@media screen and (min-width: 1024px){.css-1b5a60l{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;max-width:100%;}}@media screen and (min-width: 1385px){.css-1b5a60l{-webkit-box-flex:0;-webkit-flex-grow:0;-ms-flex-positive:0;flex-grow:0;max-width:calc(100% - 28rem);}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1b5a60l"><style data-emotion="css w6f2uy">.css-w6f2uy{margin:0;padding:0;color:rgb(255, 255, 255);font-size:1rem;line-height:1.25rem;}</style><p data-paste-element="TEXT" data-paste-core-version="20.6.0" class="css-w6f2uy">We all do sometimes; code is hard. Get help now from our <style data-emotion="css 1az6u6g">.css-1az6u6g{box-sizing:border-box;color:rgb(255, 255, 255);font-size:inherit;font-weight:inherit;line-height:inherit;outline:none;-webkit-text-decoration:underline;text-decoration:underline;}.css-1az6u6g:active,.css-1az6u6g[data-active=true]{color:rgb(255, 255, 255);-webkit-text-decoration:none;text-decoration:none;}.css-1az6u6g:focus{box-shadow:0 0 0 1px #394762,0 0 0 3px #121c2d,0 0 0 4px #ffffff,0 0 0 6px rgba(255, 255, 255, 0.2);color:rgb(255, 255, 255);-webkit-text-decoration:underline;text-decoration:underline;border-radius:4px;}.css-1az6u6g:hover{color:rgb(255, 255, 255);-webkit-text-decoration:none;text-decoration:none;}</style><a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="https://help.twilio.com" rel="noreferrer noopener" target="_blank" title="support team" class="css-1az6u6g"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj">support team<style data-emotion="css 1ezs782">.css-1ezs782{box-sizing:border-box;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;vertical-align:middle;}</style><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ezs782"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LinkExternalIcon-:Rl9ailaetasm:"><title id="LinkExternalIcon-:Rl9ailaetasm:">(link takes you to an external page)</title><path fill="currentColor" fill-rule="evenodd" d="M8.4 4.5a.5.5 0 01.5.5v.1a.5.5 0 01-.5.5H5.6v8.8h8.8v-2.8a.5.5 0 01.41-.492l.09-.008h.1a.5.5 0 01.492.41l.008.09V15a.5.5 0 01-.41.492L15 15.5H5a.5.5 0 01-.492-.41L4.5 15V5a.5.5 0 01.41-.492L5 4.5h3.4zm6.6 0a.5.5 0 01.5.5v.1l-.001.01.001 3.29a.5.5 0 01-.5.5h-.1a.5.5 0 01-.5-.5l-.001-1.935-3.967 3.967a.611.611 0 01-.78.07l-.084-.07a.611.611 0 01-.07-.78l.07-.084L13.534 5.6H11.6a.5.5 0 01-.5-.5V5a.5.5 0 01.5-.5H15z"></path></svg></span></span></span></a>, or lean on the wisdom of the crowd by visiting Twilio's <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="https://stackoverflow.com/collectives/twilio" rel="noreferrer noopener" target="_blank" title="Stack Overflow Collective" class="css-1az6u6g"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj">Stack Overflow Collective<span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ezs782"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LinkExternalIcon-:Rlaailaetasm:"><title id="LinkExternalIcon-:Rlaailaetasm:">(link takes you to an external page)</title><path fill="currentColor" fill-rule="evenodd" d="M8.4 4.5a.5.5 0 01.5.5v.1a.5.5 0 01-.5.5H5.6v8.8h8.8v-2.8a.5.5 0 01.41-.492l.09-.008h.1a.5.5 0 01.492.41l.008.09V15a.5.5 0 01-.41.492L15 15.5H5a.5.5 0 01-.492-.41L4.5 15V5a.5.5 0 01.41-.492L5 4.5h3.4zm6.6 0a.5.5 0 01.5.5v.1l-.001.01.001 3.29a.5.5 0 01-.5.5h-.1a.5.5 0 01-.5-.5l-.001-1.935-3.967 3.967a.611.611 0 01-.78.07l-.084-.07a.611.611 0 01-.07-.78l.07-.084L13.534 5.6H11.6a.5.5 0 01-.5-.5V5a.5.5 0 01.5-.5H15z"></path></svg></span></span></span></a> or browsing the <a data-paste-element="ANCHOR" data-paste-core-version="20.7.0" href="https://stackoverflow.com/questions/tagged/twilio" rel="noreferrer noopener" target="_blank" title="Twilio tag" class="css-1az6u6g"><span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-roynbj">Twilio tag<span data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1ezs782"><span data-paste-element="ICON" data-paste-core-version="20.7.0" class="css-pe4vrq"><svg role="img" aria-hidden="false" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 20 20" aria-labelledby="LinkExternalIcon-:Rlbailaetasm:"><title id="LinkExternalIcon-:Rlbailaetasm:">(link takes you to an external page)</title><path fill="currentColor" fill-rule="evenodd" d="M8.4 4.5a.5.5 0 01.5.5v.1a.5.5 0 01-.5.5H5.6v8.8h8.8v-2.8a.5.5 0 01.41-.492l.09-.008h.1a.5.5 0 01.492.41l.008.09V15a.5.5 0 01-.41.492L15 15.5H5a.5.5 0 01-.492-.41L4.5 15V5a.5.5 0 01.41-.492L5 4.5h3.4zm6.6 0a.5.5 0 01.5.5v.1l-.001.01.001 3.29a.5.5 0 01-.5.5h-.1a.5.5 0 01-.5-.5l-.001-1.935-3.967 3.967a.611.611 0 01-.78.07l-.084-.07a.611.611 0 01-.07-.78l.07-.084L13.534 5.6H11.6a.5.5 0 01-.5-.5V5a.5.5 0 01.5-.5H15z"></path></svg></span></span></span></a> on Stack Overflow.</p></div></nav><style data-emotion="css 1o3xt00">.css-1o3xt00{box-sizing:border-box;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;margin-top:2.75rem;text-align:center;}@media screen and (min-width: 768px){.css-1o3xt00{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;text-align:left;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1o3xt00"><style data-emotion="css 2ch0jy">.css-2ch0jy{box-sizing:border-box;display:block;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-flex-wrap:wrap;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;}@media screen and (min-width: 768px){.css-2ch0jy{display:block;}}@media screen and (min-width: 1024px){.css-2ch0jy{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}}</style><div data-paste-element="STACK" data-paste-core-version="20.7.0" class="css-2ch0jy"><style data-emotion="css 1hsc1sb">.css-1hsc1sb{box-sizing:border-box;margin-right:0;margin-bottom:1.25rem;}@media screen and (min-width: 768px){.css-1hsc1sb{margin-right:0;margin-bottom:1.25rem;}}@media screen and (min-width: 1024px){.css-1hsc1sb{margin-right:1.25rem;margin-bottom:0;}}</style><div data-paste-element="STACK_CHILD" data-paste-core-version="20.7.0" class="css-1hsc1sb"><style data-emotion="css 6i08t">.css-6i08t{color:rgb(255, 255, 255);}</style><a class="css-6i08t" href="/en-us/legal/tos">Terms of service</a></div><div data-paste-element="STACK_CHILD" data-paste-core-version="20.7.0" class="css-1hsc1sb"><a class="css-6i08t" href="/en-us/legal/privacy">Privacy Policy</a></div><div data-paste-element="STACK_CHILD" data-paste-core-version="20.7.0" class="css-roynbj"><style data-emotion="css g9v2ra">.css-g9v2ra{margin:0;padding:0;color:rgb(255, 255, 255);font-size:0.875rem;line-height:1.25rem;}</style><p data-paste-element="TEXT" data-paste-core-version="20.6.0" class="css-g9v2ra">Copyright © 2024 Twilio Inc.</p></div></div></div><style data-emotion="css 1gyumqz">.css-1gyumqz{box-sizing:border-box;margin-top:2.75rem;text-align:center;}@media screen and (min-width: 768px){.css-1gyumqz{text-align:left;}}</style><div data-paste-element="BOX" data-paste-core-version="20.7.0" class="css-1gyumqz"><a href="https://twilio.com/" aria-label="Go to Twilio homepage"><span style="color:rgb(255, 255, 255);width:5.5rem;height:1.5rem;display:inline-block"><svg aria-hidden="true" aria-labelledby=":Rklaetasm:" height="100%" role="img" viewBox="0 0 88 24" width="100%"><title id=":Rklaetasm:">Twilio</title><path fill="currentColor" d="M11.52 9.04c0 1.36-1.12 2.48-2.48 2.48-1.36 0-2.48-1.12-2.48-2.48 0-1.36 1.12-2.48 2.48-2.48 1.36 0 2.48 1.12 2.48 2.48zm-2.48 3.44c-1.36 0-2.48 1.12-2.48 2.48 0 1.36 1.12 2.48 2.48 2.48 1.36 0 2.48-1.12 2.48-2.48 0-1.36-1.12-2.48-2.48-2.48zM24 12c0 6.64-5.36 12-12 12S0 18.64 0 12 5.36 0 12 0s12 5.36 12 12zm-3.2 0c0-4.88-3.92-8.8-8.8-8.8-4.88 0-8.8 3.92-8.8 8.8 0 4.88 3.92 8.8 8.8 8.8 4.88 0 8.8-3.92 8.8-8.8zm-5.84.48c-1.36 0-2.48 1.12-2.48 2.48 0 1.36 1.12 2.48 2.48 2.48 1.36 0 2.48-1.12 2.48-2.48 0-1.36-1.12-2.48-2.48-2.48zm0-5.92c-1.36 0-2.48 1.12-2.48 2.48 0 1.36 1.12 2.48 2.48 2.48 1.36 0 2.48-1.12 2.48-2.48 0-1.36-1.12-2.48-2.48-2.48zm41.28-1.84c.08 0 .16.08.24.16v2.56c0 .16-.16.24-.24.24H52c-.16 0-.24-.16-.24-.24V4.96c0-.16.16-.24.24-.24h4.24zm-.08 3.6H48c-.08 0-.24.08-.24.24l-1.04 4-.08.24-1.28-4.24c0-.08-.16-.24-.24-.24h-3.2c-.08 0-.24.08-.24.24l-1.2 4-.08.24-.08-.24-.48-2-.48-2c0-.08-.16-.24-.24-.24h-6.4V4.88c0-.08-.16-.24-.32-.16L28.4 6c-.16 0-.24.08-.24.24V8.4h-1.04c-.08 0-.24.08-.24.24v3.04c0 .08.08.24.24.24h1.04v3.76c0 2.64 1.44 3.84 4.08 3.84 1.12 0 2.16-.24 2.88-.64v-3.2c0-.16-.16-.24-.24-.16-.4.16-.8.24-1.12.24-.72 0-1.12-.32-1.12-1.12v-2.72h2.32c.08 0 .24-.08.24-.24V9.12l3.04 10.08c0 .08.16.24.24.24h3.36c.08 0 .24-.08.24-.24l1.44-4.48.72 2.32.64 2.16c0 .08.16.24.24.24h3.36c.08 0 .24-.08.24-.24l3.04-10.08V19.2c0 .08.08.24.24.24h4.08c.08 0 .24-.08.24-.24V8.56c0-.08-.08-.24-.16-.24zm5.36-3.6h-4.08c-.08 0-.24.08-.24.24v14.16c0 .08.08.24.24.24h4.08c.08 0 .24-.08.24-.24V4.88c0-.08-.08-.16-.24-.16zm5.44 0h-4.24c-.08 0-.24.08-.24.24v2.48c0 .08.08.24.24.24h4.24c.08 0 .24-.08.24-.24V4.88c0-.08-.08-.16-.24-.16zm-.08 3.6H62.8c-.08 0-.24.08-.24.24v10.48c0 .08.08.24.24.24h4.08c.08 0 .24-.08.24-.24V8.56c0-.08-.08-.24-.24-.24zm12.88 5.44c0 3.04-2.56 5.68-6.16 5.68-3.52 0-6.08-2.64-6.08-5.68 0-3.04 2.56-5.68 6.16-5.68 3.52 0 6.08 2.64 6.08 5.68zm-4.32.08c0-1.12-.8-2-1.76-1.92-1.04 0-1.76.88-1.76 1.92s.8 1.92 1.76 1.92c1.04 0 1.76-.88 1.76-1.92z"></path></svg></span></a></div></div></div></div></footer><!--$--><!--/$--></div></div></div></div><div id="consent_blackbar"></div><div id="teconsent" style="position:fixed;bottom:0;right:0;z-index:30"></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"source":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n a: \"a\",\n code: \"code\",\n em: \"em\",\n h2: \"h2\",\n h3: \"h3\",\n h4: \"h4\",\n li: \"li\",\n p: \"p\",\n section: \"section\",\n strong: \"strong\",\n table: \"table\",\n tbody: \"tbody\",\n td: \"td\",\n th: \"th\",\n thead: \"thead\",\n tr: \"tr\",\n ul: \"ul\",\n ..._provideComponents(),\n ...props.components\n }, {CodeBlock, Info, Warning} = _components;\n if (!CodeBlock) _missingMdxReference(\"CodeBlock\", true);\n if (!Info) _missingMdxReference(\"Info\", true);\n if (!Warning) _missingMdxReference(\"Warning\", true);\n return _jsxs(_Fragment, {\n children: [_jsxs(_components.p, {\n children: [\"The Twilio \", _jsx(_components.strong, {\n children: \"Runtime Client\"\n }), \" provides a direct way of orchestrating the various parts of the Twilio Runtime without requiring an imported module. Using the Runtime Client, developers can reference other \", _jsx(_components.a, {\n href: \"/docs/serverless/functions-assets/functions\",\n children: \"Functions\"\n }), \" to better organize their code, access configuration and files stored in \", _jsx(_components.a, {\n href: \"/docs/serverless/functions-assets/assets\",\n children: \"Assets\"\n }), \", and manage real-time data via \", _jsx(_components.a, {\n href: \"/docs/sync\",\n children: \"Twilio Sync\"\n }), \".\"]\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Access the Runtime Client in a Function by referencing \", _jsx(_components.code, {\n children: \"Runtime\"\n }), \", which exposes the following API:\"]\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsxs(_components.li, {\n children: [_jsx(_components.a, {\n href: \"#methods\",\n children: \"Methods\"\n }), \"\\n\", _jsxs(_components.ul, {\n children: [\"\\n\", _jsx(_components.li, {\n children: _jsx(_components.a, {\n href: \"#getassets\",\n children: \"getAssets()\"\n })\n }), \"\\n\", _jsx(_components.li, {\n children: _jsx(_components.a, {\n href: \"#getfunctions\",\n children: \"getFunction()\"\n })\n }), \"\\n\", _jsx(_components.li, {\n children: _jsx(_components.a, {\n href: \"#getsyncoptions\",\n children: \"getSync()\"\n })\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\"]\n }), \"\\n\", _jsx(_components.section, {\n id: \"methods-section-indexable\",\n children: _jsx(_components.h2, {\n id: \"methods\",\n children: \"Methods\"\n })\n }), \"\\n\", _jsxs(_components.section, {\n id: \"getassets-section-indexable\",\n children: [_jsx(_components.h3, {\n id: \"getassets\",\n children: _jsx(_components.code, {\n children: \"getAssets()\"\n })\n }), _jsxs(_components.p, {\n children: [\"The \", _jsx(_components.code, {\n children: \"getAssets\"\n }), \" method returns an object that contains the names each \", _jsx(_components.strong, {\n children: \"private\"\n }), \" Asset in a Service. Each Asset name serves as the key to an Asset object that contains the \", _jsx(_components.code, {\n children: \"path\"\n }), \" to that Asset, as well as an \", _jsx(_components.code, {\n children: \"open\"\n }), \" method that can be conveniently used to access its contents. These paths can be used to retrieve files served on \", _jsx(_components.a, {\n href: \"/docs/serverless/functions-assets/assets\",\n children: \"Twilio Assets\"\n }), \".\"]\n }), _jsxs(_components.p, {\n children: [\"For example, executing \", _jsx(_components.code, {\n children: \"Runtime.getAssets()\"\n }), \" could return an object with the following private Assets:\"]\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"{\\n '/names.json': {\\n path: '/var/task/files/ZNdad14da2e70d2533f640cf362fec0609',\\n open: [Function: open]\\n },\\n '/rickroll.mp3': {\\n path: '/var/task/files/ZNdfbfaf15a02e244fa11337548dabd9d0',\\n open: [Function: open]\\n },\\n '/helper-method.js': {\\n path: '/var/task/files/ZN5d6d933785a76da25056328a5764d49b',\\n open: [Function: open]\\n }\\n}\",\n \"lang\": \"javascript\",\n \"meta\": \"\",\n \"code\": \"{\\n '/names.json': {\\n path: '/var/task/files/ZNdad14da2e70d2533f640cf362fec0609',\\n open: [Function: open]\\n },\\n '/rickroll.mp3': {\\n path: '/var/task/files/ZNdfbfaf15a02e244fa11337548dabd9d0',\\n open: [Function: open]\\n },\\n '/helper-method.js': {\\n path: '/var/task/files/ZN5d6d933785a76da25056328a5764d49b',\\n open: [Function: open]\\n }\\n}\",\n \"tokens\": [[\"{\", \"#C9D1D9\"], \"\\n \", [\"'/names.json'\", \"#A5D6FF\"], [\": {\", \"#C9D1D9\"], \"\\n \", [\"path:\", \"#C9D1D9\"], \" \", [\"'/var/task/files/ZNdad14da2e70d2533f640cf362fec0609'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"open: [Function: open]\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"'/rickroll.mp3'\", \"#A5D6FF\"], [\": {\", \"#C9D1D9\"], \"\\n \", [\"path:\", \"#C9D1D9\"], \" \", [\"'/var/task/files/ZNdfbfaf15a02e244fa11337548dabd9d0'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"open: [Function: open]\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"'/helper-method.js'\", \"#A5D6FF\"], [\": {\", \"#C9D1D9\"], \"\\n \", [\"path:\", \"#C9D1D9\"], \" \", [\"'/var/task/files/ZN5d6d933785a76da25056328a5764d49b'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"open: [Function: open]\", \"#C9D1D9\"], \"\\n \", [\"}\", \"#C9D1D9\"], \"\\n\", [\"}\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n }), _jsx(Warning, {\n children: _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"getAssets()\"\n }), \" only returns \", _jsx(_components.strong, {\n children: \"private\"\n }), \" Assets. Public and protected assets can be accessed via their publicly facing urls without the need for calling \", _jsx(_components.code, {\n children: \"getAssets()\"\n }), \". Refer to the \", _jsx(_components.a, {\n href: \"/docs/serverless/functions-assets/visibility\",\n children: \"visibility guide\"\n }), \" for more context!\"]\n })\n }), _jsxs(Warning, {\n children: [_jsxs(_components.p, {\n children: [\"Note that an Asset such as \", _jsx(_components.code, {\n children: \"names.json\"\n }), \" will be returned with a key of \", _jsx(_components.code, {\n children: \"'/names.json'\"\n }), \". To correctly retrieve the Asset and its path, the leading \", _jsx(_components.code, {\n children: \"/\"\n }), \" and extension must be part of the key used to access the object returned by \", _jsx(_components.code, {\n children: \"Runtime.getAssets()\"\n }), \".\"]\n }), _jsxs(_components.p, {\n children: [\"For example: \", _jsx(_components.code, {\n children: \"Runtime.getAssets()['/names.json'].path\"\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"asset-properties-section\",\n children: [_jsx(_components.h4, {\n id: \"asset-properties\",\n children: \"Asset Properties\"\n }), _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Property\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Type\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Description\"\n })\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"path\"\n })\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"string\"\n })\n }), _jsx(_components.td, {\n children: \"String specifying the location of the private Asset\"\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"open\"\n })\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"function\"\n })\n }), _jsxs(_components.td, {\n children: [\"Convenience method that returns the contents of the file from \", _jsx(_components.code, {\n children: \"path\"\n }), \" in utf8 encoding\"]\n })]\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"examples-section\",\n children: [_jsx(_components.h4, {\n id: \"examples\",\n children: \"Examples\"\n }), _jsx(Info, {\n children: _jsxs(_components.p, {\n children: [\"If you would like to include a JavaScript module that isn't available on npm, the best way to do so is to upload the module as a \", _jsx(_components.strong, {\n children: \"private\"\n }), \" Asset, then use \", _jsx(_components.code, {\n children: \"getAssets\"\n }), \" in order to require the module as shown in the \", _jsx(_components.a, {\n href: \"#load-a-module-from-an-asset\",\n children: \"Load a module from an asset\"\n }), \" code example.\"]\n })\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"retrieve-the-path-of-an-asset-section\",\n children: [_jsx(_components.h4, {\n id: \"retrieve-the-path-of-an-asset\",\n children: \"Retrieve the path of an Asset\"\n }), _jsx(_components.p, {\n children: \"Example of how to get the file path for an Asset\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = function (context, event, callback) {\\n // Note: the leading slash and file extension are necessary to access the Asset\\n const path = Runtime.getAssets()['/my-asset.json'].path;\\n\\n console.log('The path is: ' + path);\\n\\n return callback();\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Retrieve the path of an Asset\\\" description=\\\"Example of how to get the file path for an Asset\\\"\",\n \"code\": \"exports.handler = function (context, event, callback) {\\n // Note: the leading slash and file extension are necessary to access the Asset\\n const path = Runtime.getAssets()['/my-asset.json'].path;\\n\\n console.log('The path is: ' + path);\\n\\n return callback();\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= function\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\") {\", \"#C9D1D9\"], \"\\n \", [\"// Note: the leading slash and file extension are necessary to access the Asset\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"path\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getAssets\", \"#D2A8FF\"], [\"()[\", \"#C9D1D9\"], [\"'/my-asset.json'\", \"#A5D6FF\"], [\"].path;\", \"#C9D1D9\"], \"\\n\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'The path is: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"path);\", \"#C9D1D9\"], \"\\n\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"load-a-module-from-an-asset-section\",\n children: [_jsx(_components.h4, {\n id: \"load-a-module-from-an-asset\",\n children: \"Load a module from an Asset\"\n }), _jsx(_components.p, {\n children: \"Example of how to load a third party library stored in an Asset\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = function (context, event, callback) {\\n // First, get the path for the Asset\\n const path = Runtime.getAssets()['/answer-generator.js'].path;\\n\\n // Next, you can use require() to import the library\\n const module = require(path);\\n\\n // Finally, use the module as you would any other!\\n console.log('The answer to your riddle is: ' + module.getAnswer());\\n\\n return callback();\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Load a module from an Asset\\\" description=\\\"Example of how to load a third party library stored in an Asset\\\"\",\n \"code\": \"exports.handler = function (context, event, callback) {\\n // First, get the path for the Asset\\n const path = Runtime.getAssets()['/answer-generator.js'].path;\\n\\n // Next, you can use require() to import the library\\n const module = require(path);\\n\\n // Finally, use the module as you would any other!\\n console.log('The answer to your riddle is: ' + module.getAnswer());\\n\\n return callback();\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= function\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\") {\", \"#C9D1D9\"], \"\\n \", [\"// First, get the path for the Asset\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"path\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getAssets\", \"#D2A8FF\"], [\"()[\", \"#C9D1D9\"], [\"'/answer-generator.js'\", \"#A5D6FF\"], [\"].path;\", \"#C9D1D9\"], \"\\n\\n \", [\"// Next, you can use require() to import the library\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"module\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"require\", \"#D2A8FF\"], [\"(path);\", \"#C9D1D9\"], \"\\n\\n \", [\"// Finally, use the module as you would any other!\", \"#8B949E\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'The answer to your riddle is: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"module\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"getAnswer\", \"#D2A8FF\"], [\"());\", \"#C9D1D9\"], \"\\n\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"read-the-contents-of-an-asset-section\",\n children: [_jsx(_components.h4, {\n id: \"read-the-contents-of-an-asset\",\n children: \"Read the contents of an Asset\"\n }), _jsx(_components.p, {\n children: \"Leverage the built-in open method for convenience\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = function (context, event, callback) {\\n const openFile = Runtime.getAssets()['/my_file.txt'].open;\\n // Calling open is equivalent to using fs.readFileSync(asset.filePath, 'utf8')\\n const text = openFile();\\n\\n console.log('Your file contents: ' + text);\\n\\n return callback();\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Read the contents of an Asset\\\" description=\\\"Leverage the built-in open method for convenience\\\"\",\n \"code\": \"exports.handler = function (context, event, callback) {\\n const openFile = Runtime.getAssets()['/my_file.txt'].open;\\n // Calling open is equivalent to using fs.readFileSync(asset.filePath, 'utf8')\\n const text = openFile();\\n\\n console.log('Your file contents: ' + text);\\n\\n return callback();\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= function\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\") {\", \"#C9D1D9\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"openFile\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getAssets\", \"#D2A8FF\"], [\"()[\", \"#C9D1D9\"], [\"'/my_file.txt'\", \"#A5D6FF\"], [\"].open;\", \"#C9D1D9\"], \"\\n \", [\"// Calling open is equivalent to using fs.readFileSync(asset.filePath, 'utf8')\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"text\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"openFile\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Your file contents: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"text);\", \"#C9D1D9\"], \"\\n\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"read-the-contents-of-an-asset-1-section\",\n children: [_jsx(_components.h4, {\n id: \"read-the-contents-of-an-asset-1\",\n children: \"Read the contents of an Asset\"\n }), _jsx(_components.p, {\n children: \"Directly read the contents of an Asset using filesystem methods\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"// We're reading a file from the file system, so we'll need to import fs\\nconst fs = require('fs');\\n\\nexports.handler = async function (context, event, callback) {\\n // Retrieve the path of your file\\n const file = Runtime.getAssets()['/my_file.txt'].path;\\n // Asynchronously read the file using a different encoding from utf8\\n const text = await fs.readFile(file, 'base64');\\n\\n console.log('Your file contents: ' + text);\\n\\n return callback();\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Read the contents of an Asset\\\" description=\\\"Directly read the contents of an Asset using filesystem methods\\\"\",\n \"code\": \"// We're reading a file from the file system, so we'll need to import fs\\nconst fs = require('fs');\\n\\nexports.handler = async function (context, event, callback) {\\n // Retrieve the path of your file\\n const file = Runtime.getAssets()['/my_file.txt'].path;\\n // Asynchronously read the file using a different encoding from utf8\\n const text = await fs.readFile(file, 'base64');\\n\\n console.log('Your file contents: ' + text);\\n\\n return callback();\\n};\",\n \"tokens\": [[\"// We're reading a file from the file system, so we'll need to import fs\", \"#8B949E\"], \"\\n\", [\"const\", \"#FF7B72\"], \" \", [\"fs\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"require\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'fs'\", \"#A5D6FF\"], [\");\", \"#C9D1D9\"], \"\\n\\n\", [\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= async function\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\") {\", \"#C9D1D9\"], \"\\n \", [\"// Retrieve the path of your file\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"file\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getAssets\", \"#D2A8FF\"], [\"()[\", \"#C9D1D9\"], [\"'/my_file.txt'\", \"#A5D6FF\"], [\"].path;\", \"#C9D1D9\"], \"\\n \", [\"// Asynchronously read the file using a different encoding from utf8\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"text\", \"#79C0FF\"], \" \", [\"= await\", \"#FF7B72\"], \" \", [\"fs.\", \"#C9D1D9\"], [\"readFile\", \"#D2A8FF\"], [\"(file,\", \"#C9D1D9\"], \" \", [\"'base64'\", \"#A5D6FF\"], [\");\", \"#C9D1D9\"], \"\\n\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Your file contents: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"text);\", \"#C9D1D9\"], \"\\n\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"getfunctions-section-indexable\",\n children: [_jsx(_components.h3, {\n id: \"getfunctions\",\n children: _jsx(_components.code, {\n children: \"getFunctions()\"\n })\n }), _jsxs(_components.p, {\n children: [\"The \", _jsx(_components.code, {\n children: \"getFunctions\"\n }), \" method returns an object that contains the names of every Function in the Service. Each Function name serves as the key to a Function object that contains the \", _jsx(_components.code, {\n children: \"path\"\n }), \" to that Function. These paths can be used to import code from other Functions and to compose code hosted on Twilio Functions.\"]\n }), _jsxs(_components.p, {\n children: [\"For example, executing \", _jsx(_components.code, {\n children: \"Runtime.getFunctions()\"\n }), \" could return an object with the following Functions:\"]\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"{\\n 'sms/reply': {\\n path: '/var/task/handlers/ZNdad14da2e70d2533f640cf362fec0609.js',\\n },\\n 'helper': {\\n path: '/var/task/handlers/ZNdfbfaf15a02e244fa11337548dabd9d0.js',\\n },\\n 'example-function': {\\n path: '/var/task/handlers/ZN5d6d933785a76da25056328a5764d49b.js',\\n },\\n}\",\n \"lang\": \"javascript\",\n \"meta\": \"\",\n \"code\": \"{\\n 'sms/reply': {\\n path: '/var/task/handlers/ZNdad14da2e70d2533f640cf362fec0609.js',\\n },\\n 'helper': {\\n path: '/var/task/handlers/ZNdfbfaf15a02e244fa11337548dabd9d0.js',\\n },\\n 'example-function': {\\n path: '/var/task/handlers/ZN5d6d933785a76da25056328a5764d49b.js',\\n },\\n}\",\n \"tokens\": [[\"{\", \"#C9D1D9\"], \"\\n \", [\"'sms/reply'\", \"#A5D6FF\"], [\": {\", \"#C9D1D9\"], \"\\n \", [\"path:\", \"#C9D1D9\"], \" \", [\"'/var/task/handlers/ZNdad14da2e70d2533f640cf362fec0609.js'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"'helper'\", \"#A5D6FF\"], [\": {\", \"#C9D1D9\"], \"\\n \", [\"path:\", \"#C9D1D9\"], \" \", [\"'/var/task/handlers/ZNdfbfaf15a02e244fa11337548dabd9d0.js'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"'example-function'\", \"#A5D6FF\"], [\": {\", \"#C9D1D9\"], \"\\n \", [\"path:\", \"#C9D1D9\"], \" \", [\"'/var/task/handlers/ZN5d6d933785a76da25056328a5764d49b.js'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n\", [\"}\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n }), _jsxs(Warning, {\n children: [_jsxs(_components.p, {\n children: [\"Note that, unlike an Asset, a Function such as \", _jsx(_components.code, {\n children: \"sms/reply.js\"\n }), \" will be returned with a key of \", _jsx(_components.code, {\n children: \"\\\"sms/reply\\\"\"\n }), \". To correctly retrieve the Function and its path, do \", _jsx(_components.em, {\n children: \"not\"\n }), \" include characters such as a leading slash or the \", _jsx(_components.code, {\n children: \".js\"\n }), \" extension in the key used to access the object returned by \", _jsx(_components.code, {\n children: \"Runtime.getFunctions()\"\n }), \".\"]\n }), _jsxs(_components.p, {\n children: [\"For example: \", _jsx(_components.code, {\n children: \"Runtime.getFunctions()[\\\"sms/reply\\\"].path\"\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"function-properties-section\",\n children: [_jsx(_components.h4, {\n id: \"function-properties\",\n children: \"Function Properties\"\n }), _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Property\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Type\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Description\"\n })\n })]\n })\n }), _jsx(_components.tbody, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"path\"\n })\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"string\"\n })\n }), _jsx(_components.td, {\n children: \"String specifying the location of the Function\"\n })]\n })\n })]\n })]\n }), \"\\n\", _jsx(_components.section, {\n id: \"examples-2-section\",\n children: _jsx(_components.h4, {\n id: \"examples-2\",\n children: \"Examples\"\n })\n }), \"\\n\", _jsxs(_components.section, {\n id: \"retrieve-the-path-for-a-function-section\",\n children: [_jsx(_components.h4, {\n id: \"retrieve-the-path-for-a-function\",\n children: \"Retrieve the path for a Function\"\n }), _jsx(_components.p, {\n children: \"Example of how to retrieve the file path for a Function\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = function (context, event, callback) {\\n // Get the path for the Function. Note that the key of the function\\n // is not preceded by a \\\"/\\\" as is the case with Assets\\n const path = Runtime.getFunctions()['example-function'].path;\\n\\n console.log('The path to your Function is: ' + path);\\n\\n return callback();\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Retrieve the path for a Function\\\" description=\\\"Example of how to retrieve the file path for a Function\\\"\",\n \"code\": \"exports.handler = function (context, event, callback) {\\n // Get the path for the Function. Note that the key of the function\\n // is not preceded by a \\\"/\\\" as is the case with Assets\\n const path = Runtime.getFunctions()['example-function'].path;\\n\\n console.log('The path to your Function is: ' + path);\\n\\n return callback();\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= function\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\") {\", \"#C9D1D9\"], \"\\n \", [\"// Get the path for the Function. Note that the key of the function\", \"#8B949E\"], \"\\n \", [\"// is not preceded by a \\\"/\\\" as is the case with Assets\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"path\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getFunctions\", \"#D2A8FF\"], [\"()[\", \"#C9D1D9\"], [\"'example-function'\", \"#A5D6FF\"], [\"].path;\", \"#C9D1D9\"], \"\\n\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'The path to your Function is: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"path);\", \"#C9D1D9\"], \"\\n\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"include-a-private-function-in-another-function-section\",\n children: [_jsx(_components.h4, {\n id: \"include-a-private-function-in-another-function\",\n children: \"Include a private Function in another Function\"\n }), _jsxs(_components.p, {\n children: [\"Private Functions are a great way to store methods that may be reused between your other Functions. For example, lets say we have a private Function called \", _jsx(_components.code, {\n children: \"Zoltar\"\n }), \" that exports a fortune-generating method, \", _jsx(_components.code, {\n children: \"ask\"\n }), \":\"]\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"define-a-private-helper-function-section\",\n children: [_jsx(_components.h4, {\n id: \"define-a-private-helper-function\",\n children: \"Define a private helper Function\"\n }), _jsx(_components.p, {\n children: \"Implement Zoltar and define an ask method\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.ask = () =\u003e {\\n // We're not totally sure if Zoltar's advice is all that helpful\\n const fortunes = [\\n 'A long-forgotten loved one will appear soon.',\\n 'Are you sure the back door is locked?',\\n \\\"Communicate! It can't make things any worse.\\\",\\n 'Do not sleep in a eucalyptus tree tonight.',\\n 'Fine day for friends.',\\n 'Good news. Ten weeks from Friday will be a pretty good day.',\\n 'Living your life is a task so difficult, it has never been attempted before.',\\n 'Stay away from flying saucers today.',\\n 'The time is right to make new friends.',\\n 'Try to relax and enjoy the crisis.',\\n 'You need more time; and you probably always will.',\\n 'Your business will assume vast proportions.',\\n ];\\n\\n // Generate a random index and return the given fortune\\n return fortunes[Math.floor(Math.random() * fortunes.length)];\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Define a private helper Function\\\" description=\\\"Implement Zoltar and define an ask method\\\"\",\n \"code\": \"exports.ask = () =\u003e {\\n // We're not totally sure if Zoltar's advice is all that helpful\\n const fortunes = [\\n 'A long-forgotten loved one will appear soon.',\\n 'Are you sure the back door is locked?',\\n \\\"Communicate! It can't make things any worse.\\\",\\n 'Do not sleep in a eucalyptus tree tonight.',\\n 'Fine day for friends.',\\n 'Good news. Ten weeks from Friday will be a pretty good day.',\\n 'Living your life is a task so difficult, it has never been attempted before.',\\n 'Stay away from flying saucers today.',\\n 'The time is right to make new friends.',\\n 'Try to relax and enjoy the crisis.',\\n 'You need more time; and you probably always will.',\\n 'Your business will assume vast proportions.',\\n ];\\n\\n // Generate a random index and return the given fortune\\n return fortunes[Math.floor(Math.random() * fortunes.length)];\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"ask\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"()\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// We're not totally sure if Zoltar's advice is all that helpful\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"fortunes\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"[\", \"#C9D1D9\"], \"\\n \", [\"'A long-forgotten loved one will appear soon.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Are you sure the back door is locked?'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"\\\"Communicate! It can't make things any worse.\\\"\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Do not sleep in a eucalyptus tree tonight.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Fine day for friends.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Good news. Ten weeks from Friday will be a pretty good day.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Living your life is a task so difficult, it has never been attempted before.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Stay away from flying saucers today.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'The time is right to make new friends.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Try to relax and enjoy the crisis.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'You need more time; and you probably always will.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"'Your business will assume vast proportions.'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"];\", \"#C9D1D9\"], \"\\n\\n \", [\"// Generate a random index and return the given fortune\", \"#8B949E\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"fortunes[Math.\", \"#C9D1D9\"], [\"floor\", \"#D2A8FF\"], [\"(Math.\", \"#C9D1D9\"], [\"random\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \" \", [\"*\", \"#FF7B72\"], \" \", [\"fortunes.\", \"#C9D1D9\"], [\"length\", \"#79C0FF\"], [\")];\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n }), _jsxs(_components.p, {\n children: [\"You could then access this private method by using \", _jsx(_components.code, {\n children: \"Runtime.getFunctions()\"\n }), \" to get the path for the Zoltar Function, import Zoltar as a JavaScript module using \", _jsx(_components.code, {\n children: \"require\"\n }), \", and then access the \", _jsx(_components.code, {\n children: \"ask\"\n }), \" method as in the following code sample:\"]\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"include-code-from-a-function-section\",\n children: [_jsx(_components.h4, {\n id: \"include-code-from-a-function\",\n children: \"Include code from a Function\"\n }), _jsx(_components.p, {\n children: \"Example of how to include code from other Functions\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = function (context, event, callback) {\\n // First, get the path for the Function. Note that the key of the function\\n // is not preceded by a \\\"/\\\" as is the case with Assets\\n const zoltarPath = Runtime.getFunctions()['zoltar'].path;\\n \\n // Next, use require() to import the library\\n const zoltar = require(zoltarPath);\\n \\n // Finally, use the module as you would any other!\\n console.log('The answer to your riddle is: ' + zoltar.ask());\\n \\n return callback();\\n}\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Include code from a Function\\\" description=\\\"Example of how to include code from other Functions\\\"\",\n \"code\": \"exports.handler = function (context, event, callback) {\\n // First, get the path for the Function. Note that the key of the function\\n // is not preceded by a \\\"/\\\" as is the case with Assets\\n const zoltarPath = Runtime.getFunctions()['zoltar'].path;\\n \\n // Next, use require() to import the library\\n const zoltar = require(zoltarPath);\\n \\n // Finally, use the module as you would any other!\\n console.log('The answer to your riddle is: ' + zoltar.ask());\\n \\n return callback();\\n}\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= function\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\") {\", \"#C9D1D9\"], \"\\n \", [\"// First, get the path for the Function. Note that the key of the function\", \"#8B949E\"], \"\\n \", [\"// is not preceded by a \\\"/\\\" as is the case with Assets\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"zoltarPath\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getFunctions\", \"#D2A8FF\"], [\"()[\", \"#C9D1D9\"], [\"'zoltar'\", \"#A5D6FF\"], [\"].path;\", \"#C9D1D9\"], \"\\n \\n \", [\"// Next, use require() to import the library\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"zoltar\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"require\", \"#D2A8FF\"], [\"(zoltarPath);\", \"#C9D1D9\"], \"\\n \\n \", [\"// Finally, use the module as you would any other!\", \"#8B949E\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'The answer to your riddle is: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"zoltar.\", \"#C9D1D9\"], [\"ask\", \"#D2A8FF\"], [\"());\", \"#C9D1D9\"], \"\\n \\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\", [\"}\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"getsyncoptions-section-indexable\",\n children: [_jsx(_components.h3, {\n id: \"getsyncoptions\",\n children: _jsx(_components.code, {\n children: \"getSync(options?)\"\n })\n }), _jsxs(_components.p, {\n children: [\"We've made it convenient for you to access the Sync REST API from Functions. Use the Runtime Client to access any of \", _jsx(_components.a, {\n href: \"/docs/sync/objects-overview\",\n children: \"Sync's real-time data primitives\"\n }), \" and store information between Function invocations. The same data can be accessed using the \", _jsx(_components.a, {\n href: \"/docs/sync/api\",\n children: \"Sync API library\"\n }), \", making Sync from Functions the perfect way to update your real-time apps and dashboards.\"]\n }), _jsxs(_components.p, {\n children: [\"The Runtime Client provides a wrapper around the Twilio REST API Helper for \", _jsx(_components.a, {\n href: \"/docs/sync\",\n children: \"Twilio Sync\"\n }), \". By default, calling \", _jsx(_components.code, {\n children: \"Runtime.getSync()\"\n }), \" will return a Sync Service object that has been configured to work with your default Sync Instance.\"]\n }), _jsxs(_components.p, {\n children: [\"For added convenience and less typing, the following methods returned from \", _jsx(_components.code, {\n children: \"getSync\"\n }), \" are renamed from their usual name in the Node.js SDK, as you will see in the examples.\"]\n }), _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Default method name\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Method name in Functions\"\n })\n })]\n })\n }), _jsxs(_components.tbody, {\n children: [_jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"syncMaps\"\n })\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"maps\"\n })\n })]\n }), _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"syncLists\"\n })\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"lists\"\n })\n })]\n })]\n })]\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"arguments-section\",\n children: [_jsx(_components.h4, {\n id: \"arguments\",\n children: \"Arguments\"\n }), _jsxs(_components.p, {\n children: [_jsx(_components.code, {\n children: \"getSync\"\n }), \" optionally accepts a configuration object with the following properties.\"]\n }), _jsxs(_components.table, {\n children: [_jsx(_components.thead, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Parameter\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Type\"\n })\n }), _jsx(_components.th, {\n children: _jsx(_components.strong, {\n children: \"Description\"\n })\n })]\n })\n }), _jsx(_components.tbody, {\n children: _jsxs(_components.tr, {\n children: [_jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"serviceName\"\n })\n }), _jsx(_components.td, {\n children: _jsx(_components.code, {\n children: \"string\"\n })\n }), _jsxs(_components.td, {\n children: [\"String specifying either the \", _jsx(_components.code, {\n children: \"serviceSid\"\n }), \" or \", _jsx(_components.code, {\n children: \"uniqueName\"\n }), \" of the Sync Service to connect to. Defaults to \", _jsx(_components.code, {\n children: \"default\"\n }), \".\"]\n })]\n })\n })]\n })]\n }), \"\\n\", _jsx(_components.section, {\n id: \"examples-3-section\",\n children: _jsx(_components.h4, {\n id: \"examples-3\",\n children: \"Examples\"\n })\n }), \"\\n\", _jsxs(_components.section, {\n id: \"get-the-default-sync-service-instance-section\",\n children: [_jsx(_components.h4, {\n id: \"get-the-default-sync-service-instance\",\n children: \"Get the default Sync Service Instance\"\n }), _jsx(_components.p, {\n children: \"Example of how to get the default Sync Service Instance\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // Use the getSync method with no arguments to get a reference to the default\\n // Sync document for your account. Fetch returns a Promise, which will\\n // eventually resolve to metadata about the Sync Service, such as its SID\\n Runtime.getSync()\\n .fetch()\\n .then((defaultSyncService) =\u003e {\\n console.log('Sync Service SID: ', defaultSyncService.sid);\\n return callback(null, defaultSyncService.sid);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Get the default Sync Service Instance\\\" description=\\\"Example of how to get the default Sync Service Instance\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // Use the getSync method with no arguments to get a reference to the default\\n // Sync document for your account. Fetch returns a Promise, which will\\n // eventually resolve to metadata about the Sync Service, such as its SID\\n Runtime.getSync()\\n .fetch()\\n .then((defaultSyncService) =\u003e {\\n console.log('Sync Service SID: ', defaultSyncService.sid);\\n return callback(null, defaultSyncService.sid);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// Use the getSync method with no arguments to get a reference to the default\", \"#8B949E\"], \"\\n \", [\"// Sync document for your account. Fetch returns a Promise, which will\", \"#8B949E\"], \"\\n \", [\"// eventually resolve to metadata about the Sync Service, such as its SID\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"fetch\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"defaultSyncService\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Service SID: '\", \"#A5D6FF\"], [\", defaultSyncService.sid);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", defaultSyncService.sid);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"get-an-existing-sync-service-instance-section\",\n children: [_jsx(_components.h4, {\n id: \"get-an-existing-sync-service-instance\",\n children: \"Get an existing Sync Service Instance\"\n }), _jsx(_components.p, {\n children: \"Example of how to use Runtime Client to get an Sync Service Instance by providing the SID\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // Pass a serviceName to getSync to get a reference to that specific\\n // Sync document on your account. Fetch returns a Promise, which will\\n // eventually resolve to metadata about the Sync Service, such as friendlyName\\n Runtime.getSync({ serviceName: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' })\\n .fetch()\\n .then((syncService) =\u003e {\\n console.log('Sync Service Name: ' + syncService.friendlyName);\\n return callback(null, syncService.friendlyName);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Get an existing Sync Service Instance\\\" description=\\\"Example of how to use Runtime Client to get an Sync Service Instance by providing the SID\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // Pass a serviceName to getSync to get a reference to that specific\\n // Sync document on your account. Fetch returns a Promise, which will\\n // eventually resolve to metadata about the Sync Service, such as friendlyName\\n Runtime.getSync({ serviceName: 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' })\\n .fetch()\\n .then((syncService) =\u003e {\\n console.log('Sync Service Name: ' + syncService.friendlyName);\\n return callback(null, syncService.friendlyName);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// Pass a serviceName to getSync to get a reference to that specific\", \"#8B949E\"], \"\\n \", [\"// Sync document on your account. Fetch returns a Promise, which will\", \"#8B949E\"], \"\\n \", [\"// eventually resolve to metadata about the Sync Service, such as friendlyName\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"({ serviceName:\", \"#C9D1D9\"], \" \", [\"'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'\", \"#A5D6FF\"], \" \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"fetch\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"syncService\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Service Name: '\", \"#A5D6FF\"], \" \", [\"+\", \"#FF7B72\"], \" \", [\"syncService.friendlyName);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", syncService.friendlyName);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"create-a-sync-map-using-runtime-client-section\",\n children: [_jsx(_components.h4, {\n id: \"create-a-sync-map-using-runtime-client\",\n children: \"Create a Sync Map using Runtime Client\"\n }), _jsx(_components.p, {\n children: \"Example of how to create a Map in Sync with the Runtime Client\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // maps, which is a shortcut to syncMaps, allows you to create a new Sync Map\\n // instance. Be sure to provide a uniqueName identifier!\\n Runtime.getSync()\\n .maps.create({\\n uniqueName: 'spaceShips',\\n })\\n .then((newMap) =\u003e {\\n console.log(newMap);\\n return callback(null, newMap);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Create a Sync Map using Runtime Client\\\" description=\\\"Example of how to create a Map in Sync with the Runtime Client\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // maps, which is a shortcut to syncMaps, allows you to create a new Sync Map\\n // instance. Be sure to provide a uniqueName identifier!\\n Runtime.getSync()\\n .maps.create({\\n uniqueName: 'spaceShips',\\n })\\n .then((newMap) =\u003e {\\n console.log(newMap);\\n return callback(null, newMap);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// maps, which is a shortcut to syncMaps, allows you to create a new Sync Map\", \"#8B949E\"], \"\\n \", [\"// instance. Be sure to provide a uniqueName identifier!\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".maps.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({\", \"#C9D1D9\"], \"\\n \", [\"uniqueName:\", \"#C9D1D9\"], \" \", [\"'spaceShips'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"newMap\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(newMap);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", newMap);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"add-entry-to-a-sync-map-with-runtime-client-section\",\n children: [_jsx(_components.h4, {\n id: \"add-entry-to-a-sync-map-with-runtime-client\",\n children: \"Add entry to a Sync Map with Runtime Client\"\n }), _jsx(_components.p, {\n children: \"Example of how to add an entry to a Sync Map with the Runtime Client\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // Given an existing Sync Map with the uniqueName of spaceShips, you can use\\n // syncMapItems.create to add a new key:data pair which will be accessible\\n // to any other Function or product with access to the Sync Map!\\n Runtime.getSync()\\n .maps('spaceShips')\\n .syncMapItems.create({\\n key: 'fastestShip',\\n data: {\\n name: 'Millenium Falcon',\\n },\\n })\\n .then((response) =\u003e {\\n console.log(response);\\n return callback(null, response);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Add entry to a Sync Map with Runtime Client\\\" description=\\\"Example of how to add an entry to a Sync Map with the Runtime Client\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // Given an existing Sync Map with the uniqueName of spaceShips, you can use\\n // syncMapItems.create to add a new key:data pair which will be accessible\\n // to any other Function or product with access to the Sync Map!\\n Runtime.getSync()\\n .maps('spaceShips')\\n .syncMapItems.create({\\n key: 'fastestShip',\\n data: {\\n name: 'Millenium Falcon',\\n },\\n })\\n .then((response) =\u003e {\\n console.log(response);\\n return callback(null, response);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// Given an existing Sync Map with the uniqueName of spaceShips, you can use\", \"#8B949E\"], \"\\n \", [\"// syncMapItems.create to add a new key:data pair which will be accessible\", \"#8B949E\"], \"\\n \", [\"// to any other Function or product with access to the Sync Map!\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"maps\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'spaceShips'\", \"#A5D6FF\"], [\")\", \"#C9D1D9\"], \"\\n \", [\".syncMapItems.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({\", \"#C9D1D9\"], \"\\n \", [\"key:\", \"#C9D1D9\"], \" \", [\"'fastestShip'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"data: {\", \"#C9D1D9\"], \"\\n \", [\"name:\", \"#C9D1D9\"], \" \", [\"'Millenium Falcon'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"response\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(response);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", response);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"create-a-sync-list-with-runtime-client-section\",\n children: [_jsx(_components.h4, {\n id: \"create-a-sync-list-with-runtime-client\",\n children: \"Create a Sync List with Runtime Client\"\n }), _jsx(_components.p, {\n children: \"Example of how to create Sync List with Runtime Client\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // If your use case warrants a list data structure instead of a map, you\\n // can instantiate a Sync List. As with Maps, be sure to provide a uniqueName!\\n Runtime.getSync()\\n .lists.create({\\n uniqueName: 'spaceShips',\\n })\\n .then((newList) =\u003e {\\n console.log(newList);\\n return callback(null, newList);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Create a Sync List with Runtime Client\\\" description=\\\"Example of how to create Sync List with Runtime Client\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // If your use case warrants a list data structure instead of a map, you\\n // can instantiate a Sync List. As with Maps, be sure to provide a uniqueName!\\n Runtime.getSync()\\n .lists.create({\\n uniqueName: 'spaceShips',\\n })\\n .then((newList) =\u003e {\\n console.log(newList);\\n return callback(null, newList);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// If your use case warrants a list data structure instead of a map, you\", \"#8B949E\"], \"\\n \", [\"// can instantiate a Sync List. As with Maps, be sure to provide a uniqueName!\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".lists.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({\", \"#C9D1D9\"], \"\\n \", [\"uniqueName:\", \"#C9D1D9\"], \" \", [\"'spaceShips'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"newList\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(newList);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", newList);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"append-to-sync-list-with-runtime-client-section\",\n children: [_jsx(_components.h4, {\n id: \"append-to-sync-list-with-runtime-client\",\n children: \"Append to Sync List with Runtime Client\"\n }), _jsx(_components.p, {\n children: \"Example of how to append to a Sync List using the Runtime Client\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // Given an existing Sync List with the uniqueName of spaceShips, you can use\\n // syncListItems.create to append a new data entry which will be accessible\\n // to any other Function or product with access to the Sync List!\\n Runtime.getSync()\\n .lists('spaceShips')\\n .syncListItems.create({\\n data: {\\n text: 'Millennium Falcon',\\n },\\n })\\n .then((response) =\u003e {\\n console.log(response);\\n return callback(null, response);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Append to Sync List with Runtime Client\\\" description=\\\"Example of how to append to a Sync List using the Runtime Client\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // Given an existing Sync List with the uniqueName of spaceShips, you can use\\n // syncListItems.create to append a new data entry which will be accessible\\n // to any other Function or product with access to the Sync List!\\n Runtime.getSync()\\n .lists('spaceShips')\\n .syncListItems.create({\\n data: {\\n text: 'Millennium Falcon',\\n },\\n })\\n .then((response) =\u003e {\\n console.log(response);\\n return callback(null, response);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// Given an existing Sync List with the uniqueName of spaceShips, you can use\", \"#8B949E\"], \"\\n \", [\"// syncListItems.create to append a new data entry which will be accessible\", \"#8B949E\"], \"\\n \", [\"// to any other Function or product with access to the Sync List!\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"lists\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'spaceShips'\", \"#A5D6FF\"], [\")\", \"#C9D1D9\"], \"\\n \", [\".syncListItems.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({\", \"#C9D1D9\"], \"\\n \", [\"data: {\", \"#C9D1D9\"], \"\\n \", [\"text:\", \"#C9D1D9\"], \" \", [\"'Millennium Falcon'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"response\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(response);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", response);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"create-a-sync-document-with-runtime-client-section\",\n children: [_jsx(_components.h4, {\n id: \"create-a-sync-document-with-runtime-client\",\n children: \"Create a Sync Document with Runtime Client\"\n }), _jsx(_components.p, {\n children: \"Example of how to create a Sync Document using the Runtime Client\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = (context, event, callback) =\u003e {\\n // Last but not least, it's also possible to create Sync Documents.\\n // As always, remember to provide a uniqueName to identify your Document.\\n Runtime.getSync()\\n .documents.create({\\n uniqueName: 'userPreferences',\\n data: {\\n greeting: 'Ahoyhoy!',\\n },\\n })\\n .then((newDoc) =\u003e {\\n console.log(newDoc);\\n return callback(null, newDoc);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Create a Sync Document with Runtime Client\\\" description=\\\"Example of how to create a Sync Document using the Runtime Client\\\"\",\n \"code\": \"exports.handler = (context, event, callback) =\u003e {\\n // Last but not least, it's also possible to create Sync Documents.\\n // As always, remember to provide a uniqueName to identify your Document.\\n Runtime.getSync()\\n .documents.create({\\n uniqueName: 'userPreferences',\\n data: {\\n greeting: 'Ahoyhoy!',\\n },\\n })\\n .then((newDoc) =\u003e {\\n console.log(newDoc);\\n return callback(null, newDoc);\\n })\\n .catch((error) =\u003e {\\n console.log('Sync Error: ', error);\\n return callback(error);\\n });\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// Last but not least, it's also possible to create Sync Documents.\", \"#8B949E\"], \"\\n \", [\"// As always, remember to provide a uniqueName to identify your Document.\", \"#8B949E\"], \"\\n \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"()\", \"#C9D1D9\"], \"\\n \", [\".documents.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({\", \"#C9D1D9\"], \"\\n \", [\"uniqueName:\", \"#C9D1D9\"], \" \", [\"'userPreferences'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"data: {\", \"#C9D1D9\"], \"\\n \", [\"greeting:\", \"#C9D1D9\"], \" \", [\"'Ahoyhoy!'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"then\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"newDoc\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(newDoc);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", newDoc);\", \"#C9D1D9\"], \"\\n \", [\"})\", \"#C9D1D9\"], \"\\n \", [\".\", \"#C9D1D9\"], [\"catch\", \"#D2A8FF\"], [\"((\", \"#C9D1D9\"], [\"error\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n }), \"\\n\", _jsxs(_components.section, {\n id: \"perform-multiple-sync-actions-in-a-function-section\",\n children: [_jsx(_components.h4, {\n id: \"perform-multiple-sync-actions-in-a-function\",\n children: \"Perform multiple Sync actions in a Function\"\n }), _jsx(_components.p, {\n children: \"Example of creating a Sync Map and adding data to it in the same Function execution\"\n }), _jsx(CodeBlock, {\n codeblock: {\n \"value\": \"exports.handler = async (context, event, callback) =\u003e {\\n // Grab a reference to the Sync object since we'll be using it a few times\\n const sync = Runtime.getSync();\\n\\n try {\\n // First, lets create a brand new Sync Map\\n const newMap = await sync.maps.create({ uniqueName: 'quicklyUpdatedMap' });\\n console.log('newMap: ', newMap);\\n\\n // Now, let's access that map and add a new item to it.\\n // Be sure to specify a unique key and data for the item!\\n // Creation is an async operation, so we need to await it.\\n const newMapItem = await sync.maps(newMap.sid).syncMapItems.create({\\n key: 'fastestShip',\\n data: {\\n name: 'Millenium Falcon',\\n },\\n });\\n\\n // Now that we have a new item, let's log and return it.\\n console.log('newMapItem: ', newMapItem);\\n return callback(null, newMapItem);\\n } catch (error) {\\n // Be sure to log and return any errors that occur!\\n console.error('Sync Error: ', error);\\n return callback(error);\\n }\\n};\",\n \"lang\": \"javascript\",\n \"meta\": \"title=\\\"Perform multiple Sync actions in a Function\\\" description=\\\"Example of creating a Sync Map and adding data to it in the same Function execution\\\"\",\n \"code\": \"exports.handler = async (context, event, callback) =\u003e {\\n // Grab a reference to the Sync object since we'll be using it a few times\\n const sync = Runtime.getSync();\\n\\n try {\\n // First, lets create a brand new Sync Map\\n const newMap = await sync.maps.create({ uniqueName: 'quicklyUpdatedMap' });\\n console.log('newMap: ', newMap);\\n\\n // Now, let's access that map and add a new item to it.\\n // Be sure to specify a unique key and data for the item!\\n // Creation is an async operation, so we need to await it.\\n const newMapItem = await sync.maps(newMap.sid).syncMapItems.create({\\n key: 'fastestShip',\\n data: {\\n name: 'Millenium Falcon',\\n },\\n });\\n\\n // Now that we have a new item, let's log and return it.\\n console.log('newMapItem: ', newMapItem);\\n return callback(null, newMapItem);\\n } catch (error) {\\n // Be sure to log and return any errors that occur!\\n console.error('Sync Error: ', error);\\n return callback(error);\\n }\\n};\",\n \"tokens\": [[\"exports\", \"#79C0FF\"], [\".\", \"#C9D1D9\"], [\"handler\", \"#D2A8FF\"], \" \", [\"= async\", \"#FF7B72\"], \" \", [\"(\", \"#C9D1D9\"], [\"context\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"event\", \"#FFA657\"], [\",\", \"#C9D1D9\"], \" \", [\"callback\", \"#FFA657\"], [\")\", \"#C9D1D9\"], \" \", [\"=\u003e\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// Grab a reference to the Sync object since we'll be using it a few times\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"sync\", \"#79C0FF\"], \" \", [\"=\", \"#FF7B72\"], \" \", [\"Runtime.\", \"#C9D1D9\"], [\"getSync\", \"#D2A8FF\"], [\"();\", \"#C9D1D9\"], \"\\n\\n \", [\"try\", \"#FF7B72\"], \" \", [\"{\", \"#C9D1D9\"], \"\\n \", [\"// First, lets create a brand new Sync Map\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"newMap\", \"#79C0FF\"], \" \", [\"= await\", \"#FF7B72\"], \" \", [\"sync.maps.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({ uniqueName:\", \"#C9D1D9\"], \" \", [\"'quicklyUpdatedMap'\", \"#A5D6FF\"], \" \", [\"});\", \"#C9D1D9\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'newMap: '\", \"#A5D6FF\"], [\", newMap);\", \"#C9D1D9\"], \"\\n\\n \", [\"// Now, let's access that map and add a new item to it.\", \"#8B949E\"], \"\\n \", [\"// Be sure to specify a unique key and data for the item!\", \"#8B949E\"], \"\\n \", [\"// Creation is an async operation, so we need to await it.\", \"#8B949E\"], \"\\n \", [\"const\", \"#FF7B72\"], \" \", [\"newMapItem\", \"#79C0FF\"], \" \", [\"= await\", \"#FF7B72\"], \" \", [\"sync.\", \"#C9D1D9\"], [\"maps\", \"#D2A8FF\"], [\"(newMap.sid).syncMapItems.\", \"#C9D1D9\"], [\"create\", \"#D2A8FF\"], [\"({\", \"#C9D1D9\"], \"\\n \", [\"key:\", \"#C9D1D9\"], \" \", [\"'fastestShip'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"data: {\", \"#C9D1D9\"], \"\\n \", [\"name:\", \"#C9D1D9\"], \" \", [\"'Millenium Falcon'\", \"#A5D6FF\"], [\",\", \"#C9D1D9\"], \"\\n \", [\"},\", \"#C9D1D9\"], \"\\n \", [\"});\", \"#C9D1D9\"], \"\\n\\n \", [\"// Now that we have a new item, let's log and return it.\", \"#8B949E\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"log\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'newMapItem: '\", \"#A5D6FF\"], [\", newMapItem);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"null\", \"#79C0FF\"], [\", newMapItem);\", \"#C9D1D9\"], \"\\n \", [\"}\", \"#C9D1D9\"], \" \", [\"catch\", \"#FF7B72\"], \" \", [\"(error) {\", \"#C9D1D9\"], \"\\n \", [\"// Be sure to log and return any errors that occur!\", \"#8B949E\"], \"\\n \", [\"console.\", \"#C9D1D9\"], [\"error\", \"#D2A8FF\"], [\"(\", \"#C9D1D9\"], [\"'Sync Error: '\", \"#A5D6FF\"], [\", error);\", \"#C9D1D9\"], \"\\n \", [\"return\", \"#FF7B72\"], \" \", [\"callback\", \"#D2A8FF\"], [\"(error);\", \"#C9D1D9\"], \"\\n \", [\"}\", \"#C9D1D9\"], \"\\n\", [\"};\", \"#C9D1D9\"]],\n \"annotations\": [],\n \"themeName\": \"github-dark\",\n \"style\": {\n \"color\": \"#c9d1d9\",\n \"background\": \"#0d1117\"\n }\n }\n })]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","frontmatter":{"title":"Runtime Client","seo_description":"Learn how to use the Runtime Client to refactor and manage Twilio Functions, Assets, and real-time data in your Serverless applications.","show_breadcrumbs":false,"show_table_of_content":false,"page_type":"docs","headings":[{"depth":2,"value":"Methods","id":"methods"},{"depth":3,"value":"getAssets()","id":"getassets"},{"depth":3,"value":"getFunctions()","id":"getfunctions"},{"depth":3,"value":"getSync(options?)","id":"getsyncoptions"}]},"scope":{}},"matter":{"title":"Runtime Client","seo_description":"Learn how to use the Runtime Client to refactor and manage Twilio Functions, Assets, and real-time data in your Serverless applications.","show_breadcrumbs":false,"show_table_of_content":false,"page_type":"docs","headings":[{"depth":2,"value":"Methods","id":"methods"},{"depth":3,"value":"getAssets()","id":"getassets"},{"depth":3,"value":"getFunctions()","id":"getfunctions"},{"depth":3,"value":"getSync(options?)","id":"getsyncoptions"}]},"sidebarMenu":{"name":"Functions and Assets","path":"/docs/serverless/functions-assets","type":"file","children":[{"type":"file","name":"Return to Serverless overview","path":"/docs/serverless"},{"type":"file","name":"Overview","path":"/docs/serverless/functions-assets/functions"},{"type":"directory","path":"","name":"Technical concepts","children":[{"type":"file","name":"Function request flow","path":"/docs/serverless/functions-assets/functions/request-flow"},{"type":"file","name":"Function execution","path":"/docs/serverless/functions-assets/functions/invocation"},{"type":"file","name":"Visibility of Functions and Assets","path":"/docs/serverless/functions-assets/visibility"}]},{"type":"directory","path":"","name":"Get started","children":[{"type":"file","name":"Create a Service","path":"/docs/serverless/functions-assets/functions/create-service"},{"type":"file","name":"Assets","path":"/docs/serverless/functions-assets/assets"}]},{"type":"link","isExternal":true,"path":"/docs/labs/serverless-toolkit","name":"Serverless Toolkit"},{"type":"directory","path":"","name":"Developer guides","children":[{"type":"file","name":"Runtime Client","path":"/docs/serverless/functions-assets/client"},{"type":"file","name":"Runtime Handler","path":"/docs/serverless/functions-assets/handler"},{"type":"file","name":"Environment variables","path":"/docs/serverless/functions-assets/functions/variables"},{"type":"file","name":"Dependencies","path":"/docs/serverless/functions-assets/functions/dependencies"},{"type":"directory","path":"","name":"Headers and cookies","children":[{"type":"file","name":"Overview","path":"/docs/serverless/functions-assets/functions/headers-and-cookies"},{"type":"file","name":"Access values","path":"/docs/serverless/functions-assets/functions/headers-and-cookies/access"},{"type":"file","name":"Set and modify values","path":"/docs/serverless/functions-assets/functions/headers-and-cookies/setting-and-modifying"},{"type":"file","name":"Limitations","path":"/docs/serverless/functions-assets/functions/headers-and-cookies/limitations"},{"type":"link","isExternal":false,"path":"/docs/serverless/functions-assets/quickstart#learn-how-headers-and-cookies-can-add-extra-functionality-and-security","name":"Examples"}]},{"type":"file","name":"Debugging","path":"/docs/serverless/functions-assets/functions/debugging"},{"type":"file","name":"Frequently asked questions","path":"/docs/serverless/functions-assets/faq"}]},{"type":"directory","path":"","name":"Examples","children":[{"type":"file","name":"Receive an inbound SMS","path":"/docs/serverless/functions-assets/quickstart/receive-sms"},{"type":"file","name":"Send SMS and MMS","path":"/docs/serverless/functions-assets/quickstart/send-sms-and-mms"},{"type":"file","name":"Receive an incoming phone call","path":"/docs/serverless/functions-assets/quickstart/receive-call"},{"type":"file","name":"Make a Call","path":"/docs/serverless/functions-assets/quickstart/make-a-call"},{"type":"file","name":"Make an API request","path":"/docs/serverless/functions-assets/quickstart/api-request"},{"type":"file","name":"Use the Run Function widget in Studio","path":"/docs/serverless/functions-assets/quickstart/run-function-studio-widget"},{"type":"file","name":"Handle real-time data with Twilio Sync","path":"/docs/serverless/functions-assets/quickstart/real-time-data-sync"},{"type":"file","name":"Protect your Function with Basic Auth","path":"/docs/serverless/functions-assets/quickstart/basic-auth"},{"type":"file","name":"Protect your Function with JSON Web Token","path":"/docs/serverless/functions-assets/quickstart/json-web-token"},{"type":"file","name":"Manage application state with cookies","path":"/docs/serverless/functions-assets/quickstart/cookies-state"},{"type":"file","name":"Validate Webhook requests from SendGrid","path":"/docs/serverless/functions-assets/quickstart/validate-webhook-requests-from-sendgrid"},{"type":"file","name":"Enable CORS between Flex Plugins and Functions","path":"/docs/serverless/functions-assets/quickstart/enabling-cors-between-flex-plugins-and-functions"},{"type":"file","name":"Add delay","path":"/docs/serverless/functions-assets/quickstart/add-delay"},{"type":"file","name":"Determine carrier, phone number type, and caller info","path":"/docs/serverless/functions-assets/quickstart/lookup-carrier-and-caller-info"},{"type":"file","name":"Time of day routing with Functions","path":"/docs/serverless/functions-assets/quickstart/time-of-day-routing"},{"type":"file","name":"Normalize telephone numbers","path":"/docs/serverless/functions-assets/quickstart/normalize-telephone-numbers"},{"type":"file","name":"Prevent blocked numbers from calling your application","path":"/docs/serverless/functions-assets/quickstart/blocked-numbers"},{"type":"file","name":"Display Node.js and Twilio Helper Library versions","path":"/docs/serverless/functions-assets/quickstart/display-versions"},{"type":"file","name":"How to call Functions from Android","path":"/docs/serverless/functions-assets/quickstart/how-to-call-twilio-functions-android"},{"type":"file","name":"How to call Functions from iOS","path":"/docs/serverless/functions-assets/quickstart/how-to-call-twilio-functions-ios"}]},{"type":"directory","path":"","name":"Migration guides","children":[{"type":"file","name":"Migrating from Functions(Classic) to the new Functions Editor","path":"/docs/serverless/functions-assets/functions/migrating-functionsclassic-new-functions-editor"},{"type":"file","name":"Node.js v18 upgrade","path":"/docs/serverless/functions-assets/node-upgrade"}]}]},"editUrl":"https://github.com/twilio-internal/docs/blob/main/docs/serverless/functions-assets/client.mdx"},"__N_SSG":true},"page":"/docs/[...path]","query":{"path":["serverless","functions-assets","client"]},"buildId":"nWtU_5WJsvLGK2x62E_3J","isFallback":false,"gsp":true,"scriptLoader":[]}</script></body></html>