Summary
The README currently contains a few copy-paste issues in the example code that can break onboarding for users trying the SDK for the first time.
Current Behavior
Several README examples appear to have syntax or consistency problems:
- The
createProfile example is missing a comma in the attributes object.
- The image upload example imports
ImageApi but instantiates ImagesApi.
- The image upload example appears to be missing the closing
) / ); for the catch(...) block.
- One fenced code block appears to be closed with 4 backticks instead of 3.
Expected Behavior
The README examples should be valid, copy-pasteable, and use consistent class names so users can run them without needing to debug the docs first.
Evidence
1) createProfile example missing comma
In the README section for createProfile, the example currently shows:
let profile: ProfileCreateQuery = {
data: {
type: ProfileEnum.Profile,
attributes: {
email: "[email protected]"
}
}
}
The email field is missing a trailing comma, which makes the snippet invalid as shown.
2) Image upload example uses inconsistent class names
The README currently shows:
import {ApiKeySession, ImageApi } from 'klaviyo-api'
const session = new ApiKeySession("< YOUR API KEY HERE >")
const imageApi = new ImagesApi(session)
This imports ImageApi but instantiates ImagesApi.
3) Image upload example appears incomplete
The same block currently ends with:
imageApi.uploadImageFromFile(fs.createReadStream("./test_image.jpeg")).then(result => {
console.log(result.body)
}).catch(error => {
console.log(error)
}
This appears to be missing the closing ) / );.
4) Fenced code block formatting issue
In the “Organizational Helpers” section, one code block appears to close with 4 backticks instead of 3, which may affect markdown rendering.
Reproduction
- Open the repository README.
- Copy the example snippets into a TypeScript file.
- Try to run or type-check them.
- Observe syntax / naming inconsistencies in the examples above.
Duplicate Check
- Open issues checked: no direct match found
- Closed issues checked: no direct match found
- Recent PRs checked: no direct match found
Summary
The README currently contains a few copy-paste issues in the example code that can break onboarding for users trying the SDK for the first time.
Current Behavior
Several README examples appear to have syntax or consistency problems:
createProfileexample is missing a comma in theattributesobject.ImageApibut instantiatesImagesApi.)/);for thecatch(...)block.Expected Behavior
The README examples should be valid, copy-pasteable, and use consistent class names so users can run them without needing to debug the docs first.
Evidence
1)
createProfileexample missing commaIn the README section for
createProfile, the example currently shows:The
emailfield is missing a trailing comma, which makes the snippet invalid as shown.2) Image upload example uses inconsistent class names
The README currently shows:
This imports
ImageApibut instantiatesImagesApi.3) Image upload example appears incomplete
The same block currently ends with:
This appears to be missing the closing
)/);.4) Fenced code block formatting issue
In the “Organizational Helpers” section, one code block appears to close with 4 backticks instead of 3, which may affect markdown rendering.
Reproduction
Duplicate Check