

# Write function code
<a name="writing-function-code"></a>

You can use CloudFront Functions to write lightweight functions in JavaScript for high-scale, latency-sensitive CDN customizations. Your function code can manipulate the requests and responses that flow through CloudFront, perform basic authentication and authorization, generate HTTP responses at the edge, and more.

To help you write function code for CloudFront Functions, see the following topics. For code examples, see [CloudFront Functions examples for CloudFront](service_code_examples_cloudfront_functions_examples.md) and the [amazon-cloudfront-functions repository](https://github.com/aws-samples/amazon-cloudfront-functions) on GitHub.

**Topics**
+ [Determine function purpose](function-code-choose-purpose.md)
+ [Event structure](functions-event-structure.md)
+ [JavaScript runtime features](functions-javascript-runtime-features.md)
+ [Helper methods for key value stores](functions-custom-methods.md)
+ [Helper methods for origin modification](helper-functions-origin-modification.md)
+ [Helper methods for CloudFront SaaS Manager properties](saas-specific-logic-function-code.md)
+ [Use async and await](async-await-syntax.md)
+ [CWT support for CloudFront Functions](cwt-support-cloudfront-functions.md)
+ [General helper methods](general-helper-methods.md)