Hi PAL Smith,
Thank you for reaching out Microsoft Community. We're sorry to know that the keyboard's battery is now expanding.
Since this is a hardware related issue and your Surface device needs to be replaced, the best resolution I can recommend is to contact our **Microsoft Surface Support**for further assistance. Any hardware related issues just like this can no longer be troubleshooted and to get the device warranty verified, it's best to contact our technical support.
As far as I know, for expanding battery issue, a free replacement for the same unit will be honored if in case the device was purchased not beyond 3 years and since you mentioned in your post that it was purchased last August 2017, so this has not been beyond 3 years but you have to get the device warranty verified first to get a free replacement. Redirecting you to contact our technical support over the phone since we cannot any replacement here in MS Community.
If this answers your question, feel free to mark this post as an answer. Otherwise, don't hesitate to respond to this thread if there's anything else that needs to be addressed.
Kind Regards,
Crest_Z